Thread (3 messages) flat view 3 messages, 3 authors, 2018-10-15

Re: [v2] powerpc/rtas: Fix a potential race between CPU-Offline & Migration

From: Michael Ellerman <hidden>
Date: 2018-10-15 04:17:42

On Mon, 2018-10-01 at 10:40:39 UTC, "Gautham R. Shenoy" wrote:
From: "Gautham R. Shenoy" <redacted>

Live Partition Migrations require all the present CPUs to execute the
H_JOIN call, and hence rtas_ibm_suspend_me() onlines any offline CPUs
before initiating the migration for this purpose.

The commit 85a88cabad57
("powerpc/pseries: Disable CPU hotplug across migrations")
disables any CPU-hotplug operations once all the offline CPUs are
brought online to prevent any further state change. Once the
CPU-Hotplug operation is disabled, the code assumes that all the CPUs
are online.

However, there is a minor window in rtas_ibm_suspend_me() between
onlining the offline CPUs and disabling CPU-Hotplug when a concurrent
CPU-offline operations initiated by the userspace can succeed thereby
nullifying the the aformentioned assumption. In this unlikely case
these offlined CPUs will not call H_JOIN, resulting in a system hang.

Fix this by verifying that all the present CPUs are actually online
after CPU-Hotplug has been disabled, failing which we restore the
state of the offline CPUs in rtas_ibm_suspend_me() and return an
-EBUSY.

Cc: Nathan Fontenot <redacted>
Cc: Tyrel Datwyler <redacted>
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Gautham R. Shenoy <redacted>
Reviewed-by: Nathan Fontenot <redacted>
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/dfd718a2ed1f678e66749ffe41bdea

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help