summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorNathan Lynch <nathanl@linux.ibm.com>2019-08-02 14:29:26 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-07 18:55:02 +0200
commite9b7c5d8a80a63d4e9ed7688cbf73724723ff9a1 (patch)
tree2964b2f34563edb299501dabf0201856f0bb5ade /arch
parent31b0a491f319885ed738d3e65f10980ec490d6c2 (diff)
downloadlinux-stable-e9b7c5d8a80a63d4e9ed7688cbf73724723ff9a1.tar.gz
linux-stable-e9b7c5d8a80a63d4e9ed7688cbf73724723ff9a1.tar.bz2
linux-stable-e9b7c5d8a80a63d4e9ed7688cbf73724723ff9a1.zip
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/pseries/mobility.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 4addc552eb33..9739a055e5f7 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -12,6 +12,7 @@
#include <linux/cpu.h>
#include <linux/kernel.h>
#include <linux/kobject.h>
+#include <linux/sched.h>
#include <linux/smp.h>
#include <linux/stat.h>
#include <linux/completion.h>
@@ -208,7 +209,11 @@ static int update_dt_node(__be32 phandle, s32 scope)
prop_data += vd;
}
+
+ cond_resched();
}
+
+ cond_resched();
} while (rtas_rc == 1);
of_node_put(dn);
@@ -317,8 +322,12 @@ int pseries_devicetree_update(s32 scope)
add_dt_node(phandle, drc_index);
break;
}
+
+ cond_resched();
}
}
+
+ cond_resched();
} while (rc == 1);
kfree(rtas_buf);