diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2017-11-13 03:39:01 -0500 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2017-11-13 04:03:53 -0500 |
| commit | f4c09f87adfe31587aa4b2aea2cb2dbde2150f54 (patch) | |
| tree | 2f447482a8c304bc26d0ae02172f979e6ecd5c5b | |
| parent | c6cd924efe941ef62eb805c59e4a09e219ac5c6d (diff) | |
cpu/hotplug: Get rid of CPU hotplug notifier leftovers
The CPU hotplug notifiers are history. Remove the last reminders.
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
| -rw-r--r-- | Documentation/fault-injection/notifier-error-inject.txt | 30 | ||||
| -rw-r--r-- | Documentation/power/suspend-and-cpuhotplug.txt | 9 | ||||
| -rw-r--r-- | include/linux/cpu.h | 27 |
3 files changed, 14 insertions, 52 deletions
diff --git a/Documentation/fault-injection/notifier-error-inject.txt b/Documentation/fault-injection/notifier-error-inject.txt index 83d3f4e43e91..e861d761de24 100644 --- a/Documentation/fault-injection/notifier-error-inject.txt +++ b/Documentation/fault-injection/notifier-error-inject.txt | |||
| @@ -6,41 +6,11 @@ specified notifier chain callbacks. It is useful to test the error handling of | |||
| 6 | notifier call chain failures which is rarely executed. There are kernel | 6 | notifier call chain failures which is rarely executed. There are kernel |
| 7 | modules that can be used to test the following notifiers. | 7 | modules that can be used to test the following notifiers. |
| 8 | 8 | ||
| 9 | * CPU notifier | ||
| 10 | * PM notifier | 9 | * PM notifier |
| 11 | * Memory hotplug notifier | 10 | * Memory hotplug notifier |
| 12 | * powerpc pSeries reconfig notifier | 11 | * powerpc pSeries reconfig notifier |
| 13 | * Netdevice notifier | 12 | * Netdevice notifier |
| 14 | 13 | ||
| 15 | CPU notifier error injection module | ||
| 16 | ----------------------------------- | ||
| 17 | This feature can be used to test the error handling of the CPU notifiers by | ||
| 18 | injecting artificial errors to CPU notifier chain callbacks. | ||
| 19 | |||
| 20 | If the notifier call chain should be failed with some events notified, write | ||
| 21 | the error code to debugfs interface | ||
| 22 | /sys/kernel/debug/notifier-error-inject/cpu/actions/<notifier event>/error | ||
| 23 | |||
| 24 | Possible CPU notifier events to be failed are: | ||
| 25 | |||
| 26 | * CPU_UP_PREPARE | ||
| 27 | * CPU_UP_PREPARE_FROZEN | ||
| 28 | * CPU_DOWN_PREPARE | ||
| 29 | * CPU_DOWN_PREPARE_FROZEN | ||
| 30 | |||
| 31 | Example1: Inject CPU offline error (-1 == -EPERM) | ||
| 32 | |||
| 33 | # cd /sys/kernel/debug/notifier-error-inject/cpu | ||
| 34 | # echo -1 > actions/CPU_DOWN_PREPARE/error | ||
| 35 | # echo 0 > /sys/devices/system/cpu/cpu1/online | ||
| 36 | bash: echo: write error: Operation not permitted | ||
| 37 | |||
| 38 | Example2: inject CPU online error (-2 == -ENOENT) | ||
| 39 | |||
| 40 | # echo -2 > actions/CPU_UP_PREPARE/error | ||
| 41 | # echo 1 > /sys/devices/system/cpu/cpu1/online | ||
| 42 | bash: echo: write error: No such file or directory | ||
| 43 | |||
| 44 | PM notifier error injection module | 14 | PM notifier error injection module |
| 45 | ---------------------------------- | 15 | ---------------------------------- |
| 46 | This feature is controlled through debugfs interface | 16 | This feature is controlled through debugfs interface |
diff --git a/Documentation/power/suspend-and-cpuhotplug.txt b/Documentation/power/suspend-and-cpuhotplug.txt index 2fc909502db5..31abd04b9572 100644 --- a/Documentation/power/suspend-and-cpuhotplug.txt +++ b/Documentation/power/suspend-and-cpuhotplug.txt | |||
| @@ -232,7 +232,7 @@ d. Handling microcode update during suspend/hibernate: | |||
| 232 | hibernate/restore cycle.] | 232 | hibernate/restore cycle.] |
| 233 | 233 | ||
| 234 | In the current design of the kernel however, during a CPU offline operation | 234 | In the current design of the kernel however, during a CPU offline operation |
| 235 | as part of the suspend/hibernate cycle (the CPU_DEAD_FROZEN notification), | 235 | as part of the suspend/hibernate cycle (cpuhp_tasks_frozen is set), |
| 236 | the existing copy of microcode image in the kernel is not freed up. | 236 | the existing copy of microcode image in the kernel is not freed up. |
| 237 | And during the CPU online operations (during resume/restore), since the | 237 | And during the CPU online operations (during resume/restore), since the |
| 238 | kernel finds that it already has copies of the microcode images for all the | 238 | kernel finds that it already has copies of the microcode images for all the |
| @@ -252,10 +252,9 @@ Yes, they are listed below: | |||
| 252 | the _cpu_down() and _cpu_up() functions is *always* 0. | 252 | the _cpu_down() and _cpu_up() functions is *always* 0. |
| 253 | This might not reflect the true current state of the system, since the | 253 | This might not reflect the true current state of the system, since the |
| 254 | tasks could have been frozen by an out-of-band event such as a suspend | 254 | tasks could have been frozen by an out-of-band event such as a suspend |
| 255 | operation in progress. Hence, it will lead to wrong notifications being | 255 | operation in progress. Hence, the cpuhp_tasks_frozen variable will not |
| 256 | sent during the cpu online/offline events (eg, CPU_ONLINE notification | 256 | reflect the frozen state and the CPU hotplug callbacks which evaluate |
| 257 | instead of CPU_ONLINE_FROZEN) which in turn will lead to execution of | 257 | that variable might execute the wrong code path. |
| 258 | inappropriate code by the callbacks registered for such CPU hotplug events. | ||
| 259 | 258 | ||
| 260 | 2. If a regular CPU hotplug stress test happens to race with the freezer due | 259 | 2. If a regular CPU hotplug stress test happens to race with the freezer due |
| 261 | to a suspend operation in progress at the same time, then we could hit the | 260 | to a suspend operation in progress at the same time, then we could hit the |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index cd4771b772c0..b6e4a598b2cd 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -55,24 +55,17 @@ extern void unregister_cpu(struct cpu *cpu); | |||
| 55 | extern ssize_t arch_cpu_probe(const char *, size_t); | 55 | extern ssize_t arch_cpu_probe(const char *, size_t); |
| 56 | extern ssize_t arch_cpu_release(const char *, size_t); | 56 | extern ssize_t arch_cpu_release(const char *, size_t); |
| 57 | #endif | 57 | #endif |
| 58 | struct notifier_block; | ||
| 59 | |||
| 60 | #define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ | ||
| 61 | #define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */ | ||
| 62 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ | ||
| 63 | #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug | ||
| 64 | * lock is dropped */ | ||
| 65 | #define CPU_BROKEN 0x000B /* CPU (unsigned)v did not die properly, | ||
| 66 | * perhaps due to preemption. */ | ||
| 67 | |||
| 68 | /* Used for CPU hotplug events occurring while tasks are frozen due to a suspend | ||
| 69 | * operation in progress | ||
| 70 | */ | ||
| 71 | #define CPU_TASKS_FROZEN 0x0010 | ||
| 72 | 58 | ||
| 73 | #define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN) | 59 | /* |
| 74 | #define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN) | 60 | * These states are not related to the core CPU hotplug mechanism. They are |
| 75 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) | 61 | * used by various (sub)architectures to track internal state |
| 62 | */ | ||
| 63 | #define CPU_ONLINE 0x0002 /* CPU is up */ | ||
| 64 | #define CPU_UP_PREPARE 0x0003 /* CPU coming up */ | ||
| 65 | #define CPU_DEAD 0x0007 /* CPU dead */ | ||
| 66 | #define CPU_DEAD_FROZEN 0x0008 /* CPU timed out on unplug */ | ||
| 67 | #define CPU_POST_DEAD 0x0009 /* CPU successfully unplugged */ | ||
| 68 | #define CPU_BROKEN 0x000B /* CPU did not die properly */ | ||
| 76 | 69 | ||
| 77 | #ifdef CONFIG_SMP | 70 | #ifdef CONFIG_SMP |
| 78 | extern bool cpuhp_tasks_frozen; | 71 | extern bool cpuhp_tasks_frozen; |
