powerpc/pseries/mobility: use cond_resched when updating device tree
authorNathan Lynch <nathanl@linux.ibm.com>
Fri, 2 Aug 2019 19:29:26 +0000 (14:29 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2019 16:53:11 +0000 (18:53 +0200)
commit57a501a238482979cea886638cc5ce8a2c59f818
tree8bf0af842e2511556a089398c797f8fd2e1301a1
parent85842790f4ceda744278734322da3fb339c3c4ef
powerpc/pseries/mobility: use cond_resched when updating device tree

[ Upstream commit ccfb5bd71d3d1228090a8633800ae7cdf42a94ac ]

After a partition migration, pseries_devicetree_update() processes
changes to the device tree communicated from the platform to
Linux. This is a relatively heavyweight operation, with multiple
device tree searches, memory allocations, and conversations with
partition firmware.

There's a few levels of nested loops which are bounded only by
decisions made by the platform, outside of Linux's control, and indeed
we have seen RCU stalls on large systems while executing this call
graph. Use cond_resched() in these loops so that the cpu is yielded
when needed.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190802192926.19277-4-nathanl@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/platforms/pseries/mobility.c