MIPS: mm: Avoid HTW stop/start when dropping an inactive mm
authorPaul Burton <paul.burton@mips.com>
Sat, 2 Feb 2019 01:43:18 +0000 (01:43 +0000)
committerPaul Burton <paul.burton@mips.com>
Mon, 4 Feb 2019 18:56:16 +0000 (10:56 -0800)
commit67741ba3ba006558ac3541488c1db9dff9507e73
tree3d87bc5f940917954b8a1777222beba16b0ce860
parent4739f7dd99d757fb719e1173b4d2bcfc0f93e52d
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
arch/mips/include/asm/mmu_context.h