]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
powerpc/mm/radix: Remove split_kernel_mapping()
authorBharata B Rao <bharata@linux.ibm.com>
Thu, 9 Jul 2020 13:19:24 +0000 (18:49 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 20 Jul 2020 12:57:56 +0000 (22:57 +1000)
commitd6d6ebfc5dbb4008be21baa4ec2ad45606578966
tree3c390a7e93880692b0a8553da11bb894738ef09d
parent9ce8853b4a735c8115f55ac0e9c2b27a4c8f80b5
powerpc/mm/radix: Remove split_kernel_mapping()

We split the page table mapping on memory unplug if the
linear range was mapped with huge page mapping (for ex: 1G)
The page table splitting code has a few issues:

1. Recursive locking
--------------------
Memory unplug path takes cpu_hotplug_lock and calls stop_machine()
for splitting the mappings. However stop_machine() takes
cpu_hotplug_lock again causing deadlock.

2. BUG: sleeping function called from in_atomic() context
---------------------------------------------------------
Memory unplug path (remove_pagetable) takes init_mm.page_table_lock
spinlock and later calls stop_machine() which does wait_for_completion()

3. Bad unlock unbalance
-----------------------
Memory unplug path takes init_mm.page_table_lock spinlock and calls
stop_machine(). The stop_machine thread function runs in a different
thread context (migration thread) which tries to release and reaquire
ptl. Releasing ptl from a different thread than which acquired it
causes bad unlock unbalance.

These problems can be avoided if we avoid mapping hot-plugged memory
with 1G mapping, thereby removing the need for splitting them during
unplug. The kernel always make sure the minimum unplug request is
SUBSECTION_SIZE for device memory and SECTION_SIZE for regular memory.

In preparation for such a change remove page table splitting support.

This essentially is a revert of
commit 4dd5f8a99e791 ("powerpc/mm/radix: Split linear mapping on hot-unplug")

Signed-off-by: Bharata B Rao <bharata@linux.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200709131925.922266-4-aneesh.kumar@linux.ibm.com
arch/powerpc/mm/book3s64/radix_pgtable.c