x86-64: Use cpumask bitops for cpu_vm_mask
PATCH 1/1 x86-64: Use cpumask bitops for cpu_vm_mask
cpu_vm_mask is of type cpumask_t, so use the proper bitops.
---
arch/x86_64/kernel/smp.c | 6 +++--- include/asm-x86_64/mmu_context.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
2a0cb4113a3e0aff4fe02e7fdf2ce82e49a24a32
arch/x86_64/kernel/smp.c +3 -3
@@ -75,7 +75,7 @@ static inline void leave_mm(int cpu) {if (read_pda (mmu_state) ==TLBSTATE_OK )BUG (); -clear_bit (cpu, &read_pda (active_mm)->cpu_vm_mask); +cpu_clear (cpu,read_pda (active_mm)->cpu_vm_mask);load_cr3 (swapper_pg_dir); }
@@ -85,7 +85,7 @@ static inline void leave_mm(int cpu)* [cpu0: the cpu that switches] * 1) switch_mm() either 1a) or 1b) * 1a) thread switch to a different mm -* 1a1) clear_bit(cpu, &old_mm->cpu_vm_mask); +* 1a1) cpu_clear(cpu, old_mm->cpu_vm_mask); * Stop ipi delivery for the old mm. This is not synchronized with * the other cpus, but smp_invalidate_interrupt ignore flush ipis * for the wrong mm, and in the worst case we perform a superfluous
@@ -95,7 +95,7 @@ static inline void leave_mm(int cpu)* was in lazy tlb mode. * 1a3) update cpu active_mm * Now cpu0 accepts tlb flushes for the new mm. -* 1a4) set_bit(cpu, &new_mm->cpu_vm_mask); +* 1a4) cpu_set(cpu, new_mm->cpu_vm_mask); * Now the other cpus will send tlb flush ipis. * 1a4) change cr3. * 1b) thread switch without mm change
include/asm-x86_64/mmu_context.h +3 -3
@@ -34,12 +34,12 @@ static inline void switch_mm(struct mm_sunsigned cpu =smp_processor_id ();if (likely (prev != next)) {/* stop flush ipis for the previous mm */ -clear_bit (cpu, &prev->cpu_vm_mask); +cpu_clear (cpu, prev->cpu_vm_mask);#ifdef CONFIG_SMP write_pda (mmu_state,TLBSTATE_OK );write_pda (active_mm, next);#endif -set_bit (cpu, &next->cpu_vm_mask); +cpu_set (cpu, next->cpu_vm_mask);load_cr3 (next->pgd);if (unlikely (next->context.ldt != prev->context.ldt))
@@ -50,7 +50,7 @@ static inline void switch_mm(struct mm_swrite_pda (mmu_state,TLBSTATE_OK );if (read_pda (active_mm) != next)out_of_line_bug (); -if (!test_and_set_bit (cpu, &next->cpu_vm_mask)) { +if (!cpu_test_and_set (cpu, next->cpu_vm_mask)) {/* We were in lazy tlb mode and leave_mm disabled * tlb flush IPI delivery. We must reload CR3 * to make sure to use no freed page tables.
Signature · 1 line
1.2.4.g1242
Quoted 1 line · Brian Gerst
cpu_vm_maskis of typecpumask_t, so use the proper bitops.
Doesn't apply.
patching file arch/x86_64/kernel/smp.c
patching file include/asm-x86_64/mmu_context.h
Hunk #1 FAILED at 34.
Hunk #2 FAILED at 50.
2 out of 2 hunks FAILED -- rejects in file include/asm-x86_64/mmu_context.h
-Andi
Quoted 7 lines · Andi Kleen
Quoted 1 line · Brian Gerst
cpu_vm_maskis of typecpumask_t, so use the proper bitops.Doesn't apply.
Quoted 9 lines
patching file
arch/x86_64/kernel/smp.c
patching fileinclude/asm-x86_64/mmu_context.h
Hunk #1 FAILED at 34.
Hunk #2 FAILED at 50.
2 out of 2 hunks FAILED -- rejects in fileinclude/asm-x86_64/mmu_context.h-Andi
I diffed against the vanilla kernel. It looks like -mm has the fix to mmu_context.h already (x86_64-mm-bitops-cleanups.patch), but the patch to smp.c is still valid.
--
Brian Gerst