powerpc: Chunk calls to flush_dcache_range in arch_*_memory
authorAlastair D'Silva <alastair@d-silva.org>
Mon, 4 Nov 2019 02:32:57 +0000 (13:32 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2020 09:20:02 +0000 (10:20 +0100)
commit0e9d2e5f7141cb48a52063a56f73aaa56652ec6b
tree188dd12377a1f6f6a32b4f053d4e99152fd78a9a
parentaf8547549041936848c96bc3d5fddcd33ba9c0d2
powerpc: Chunk calls to flush_dcache_range in arch_*_memory

commit 076265907cf9633bbef861c7c2a1c26a8209f283 upstream.

When presented with large amounts of memory being hotplugged
(in my test case, ~890GB), the call to flush_dcache_range takes
a while (~50 seconds), triggering RCU stalls.

This patch breaks up the call into 1GB chunks, calling
cond_resched() inbetween to allow the scheduler to run.

Fixes: fb5924fddf9e ("powerpc/mm: Flush cache on memory hot(un)plug")
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191104023305.9581-6-alastair@au1.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/mm/mem.c