]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/rtas: don't online CPUs for partition suspend
authorNathan Lynch <nathanl@linux.ibm.com>
Fri, 12 Jun 2020 05:12:22 +0000 (00:12 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 16 Jul 2020 03:12:35 +0000 (13:12 +1000)
commit3af7187413adec3182477345875942974286ad4b
tree5cf11a2b608a60dbe4be38a44174a030b93fb2a4
parentf1a95fc415fdb9b95d756a2b9a3ee2294c9e9f6e
powerpc/rtas: don't online CPUs for partition suspend

Partition suspension, used for hibernation and migration, requires
that the OS place all but one of the LPAR's processor threads into one
of two states prior to calling the ibm,suspend-me RTAS function:

  * the architected offline state (via RTAS stop-self); or
  * the H_JOIN hcall, which does not return until the partition
    resumes execution

Using H_CEDE as the offline mode, introduced by
commit 2acd37f5b1b3 ("powerpc/pseries: Add hooks to put the CPU into
an appropriate offline state"), means that any threads which are
offline from Linux's point of view must be moved to one of those two
states before a partition suspension can proceed.

This was eventually addressed in commit 27b492c56bd4 ("powerpc: Bring
all threads online prior to migration/hibernation"), which added code
to temporarily bring up any offline processor threads so they can call
H_JOIN. Conceptually this is fine, but the implementation has had
multiple races with cpu hotplug operations initiated from user
space[1][2][3], the error handling is fragile, and it generates
user-visible cpu hotplug events which is a lot of noise for a platform
feature that's supposed to minimize disruption to workloads.

With commit 2acd37f5b1b3 ("powerpc/pseries: Add hooks to put the CPU
into an appropriate offline state") reverted, this code becomes
unnecessary, so remove it. Since any offline CPUs now are truly
offline from the platform's point of view, it is no longer necessary
to bring up CPUs only to have them call H_JOIN and then go offline
again upon resuming. Only active threads are required to call H_JOIN;
stopped threads can be left alone.

[1] commit ccea224f787e ("powerpc/rtas: use device model APIs and
    serialization during LPM")
[2] commit bc4dcfd33ce4 ("powerpc/rtas: retry when cpu offline races
    with suspend/migration")
[3] commit ef245d284a68 ("powerpc/rtas: Fix a potential race between
    CPU-Offline & Migration")

Fixes: 27b492c56bd4 ("powerpc: Bring all threads online prior to migration/hibernation")
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200612051238.1007764-3-nathanl@linux.ibm.com
arch/powerpc/include/asm/rtas.h
arch/powerpc/kernel/rtas.c
arch/powerpc/platforms/pseries/suspend.c