Skip to content

Commit 67741ba

Browse files
committed
MIPS: mm: Avoid HTW stop/start when dropping an inactive mm
If drop_mmu_context() is called with an mm that is not currently active on the local CPU then there's no need for us to stop & start a hardware page table walker because it can't be fetching entries for the ASID corresponding to the mm we're operating on. Move the htw_stop() & htw_start() calls into the block which we run only if the mm is currently active, in order to avoid the redundant work. Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: linux-mips@vger.kernel.org
1 parent 4739f7d commit 67741ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/mips/include/asm/mmu_context.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,18 @@ drop_mmu_context(struct mm_struct *mm)
184184
unsigned int cpu;
185185

186186
local_irq_save(flags);
187-
htw_stop();
188187

189188
cpu = smp_processor_id();
190189
if (cpumask_test_cpu(cpu, mm_cpumask(mm))) {
190+
htw_stop();
191191
get_new_mmu_context(mm);
192192
write_c0_entryhi(cpu_asid(cpu, mm));
193+
htw_start();
193194
} else {
194195
/* will get a new context next time */
195196
cpu_context(cpu, mm) = 0;
196197
}
197-
htw_start();
198+
198199
local_irq_restore(flags);
199200
}
200201

0 commit comments

Comments
 (0)