• Nathan Lynch's avatar
    powerpc/rtas: don't online CPUs for partition suspend · ec2fc2a9
    Nathan Lynch authored
    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 3aa565f5 ("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 120496ac ("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 3aa565f5 ("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 a6717c01 ("powerpc/rtas: use device model APIs and
        serialization during LPM")
    [2] commit 9fb60305 ("powerpc/rtas: retry when cpu offline races
        with suspend/migration")
    [3] commit dfd718a2 ("powerpc/rtas: Fix a potential race between
        CPU-Offline & Migration")
    
    Fixes: 120496ac ("powerpc: Bring all threads online prior to migration/hibernation")
    Signed-off-by: default avatarNathan Lynch <nathanl@linux.ibm.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/20200612051238.1007764-3-nathanl@linux.ibm.com
    ec2fc2a9
rtas.h 12 KB