diff options
Diffstat (limited to 'include/asm-i386')
-rw-r--r-- | include/asm-i386/mmu_context.h | 13 | ||||
-rw-r--r-- | include/asm-i386/pgalloc.h | 1 |
2 files changed, 8 insertions, 6 deletions
diff --git a/include/asm-i386/mmu_context.h b/include/asm-i386/mmu_context.h index e02aff08d..75b33ae5c 100644 --- a/include/asm-i386/mmu_context.h +++ b/include/asm-i386/mmu_context.h @@ -27,8 +27,9 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, unsigned cpu) { - set_bit(cpu, &next->cpu_vm_mask); if (prev != next) { + /* stop flush ipis for the previous mm */ + clear_bit(cpu, &prev->cpu_vm_mask); /* * Re-load LDT if necessary */ @@ -38,20 +39,22 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, str cpu_tlbstate[cpu].state = TLBSTATE_OK; cpu_tlbstate[cpu].active_mm = next; #endif + set_bit(cpu, &next->cpu_vm_mask); /* Re-load page tables */ asm volatile("movl %0,%%cr3": :"r" (__pa(next->pgd))); - clear_bit(cpu, &prev->cpu_vm_mask); } #ifdef CONFIG_SMP else { - int old_state = cpu_tlbstate[cpu].state; cpu_tlbstate[cpu].state = TLBSTATE_OK; if(cpu_tlbstate[cpu].active_mm != next) BUG(); - if(old_state == TLBSTATE_OLD) + if(!test_and_set_bit(cpu, &next->cpu_vm_mask)) { + /* We were in lazy tlb mode and leave_mm disabled + * tlb flush IPI delivery. We must flush our tlb. + */ local_flush_tlb(); + } } - #endif } diff --git a/include/asm-i386/pgalloc.h b/include/asm-i386/pgalloc.h index 78a229362..74c9b3798 100644 --- a/include/asm-i386/pgalloc.h +++ b/include/asm-i386/pgalloc.h @@ -240,7 +240,6 @@ static inline void flush_tlb_range(struct mm_struct * mm, unsigned long start, u #define TLBSTATE_OK 1 #define TLBSTATE_LAZY 2 -#define TLBSTATE_OLD 3 struct tlb_state { |