]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: free page table caches at exit_mmap time
authorNicholas Piggin <npiggin@gmail.com>
Wed, 25 Jul 2018 09:54:28 +0000 (19:54 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 7 Aug 2018 11:49:27 +0000 (21:49 +1000)
commit707a070abd4f6f1e007208467cb88a9074d58c6f
treeacebfa0f02d084736c6ce4bd78c500a3890ccbc4
parent2d44896aad8017a69fcd8f252209e9009267fdea
powerpc/64s: free page table caches at exit_mmap time

The kernel page table caches are tied to init_mm, so there is no
more need for them after userspace is finished.

destroy_context() gets called when we drop the last reference for an
mm, which can be much later than the task exit due to other lazy mm
references to it. We can free the page table cache pages on task exit
because they only cache the userspace page tables and kernel threads
should not access user space addresses.

The mapping for kernel threads itself is maintained in init_mm and
page table cache for that is attached to init_mm.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
[mpe: Merge change log additions from Aneesh]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/mmu_context_book3s64.c