Skip to content

Commit 7d58e1c

Browse files
committed
Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull smp/hotplug updates from Thomas Gleixner: "No functional changes, just removal of obsolete and outdated defines, macros and documentation" * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: cpu/hotplug: Get rid of CPU hotplug notifier leftovers cpu/hotplug: Remove obsolete notifier macros
2 parents 2bcc673 + f4c09f8 commit 7d58e1c

File tree

3 files changed

+14
-55
lines changed

3 files changed

+14
-55
lines changed

Documentation/fault-injection/notifier-error-inject.txt

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,11 @@ specified notifier chain callbacks. It is useful to test the error handling of
66
notifier call chain failures which is rarely executed. There are kernel
77
modules that can be used to test the following notifiers.
88

9-
* CPU notifier
109
* PM notifier
1110
* Memory hotplug notifier
1211
* powerpc pSeries reconfig notifier
1312
* Netdevice notifier
1413

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-
4414
PM notifier error injection module
4515
----------------------------------
4616
This feature is controlled through debugfs interface

Documentation/power/suspend-and-cpuhotplug.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ d. Handling microcode update during suspend/hibernate:
232232
hibernate/restore cycle.]
233233

234234
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),
236236
the existing copy of microcode image in the kernel is not freed up.
237237
And during the CPU online operations (during resume/restore), since the
238238
kernel finds that it already has copies of the microcode images for all the
@@ -252,10 +252,9 @@ Yes, they are listed below:
252252
the _cpu_down() and _cpu_up() functions is *always* 0.
253253
This might not reflect the true current state of the system, since the
254254
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
256-
sent during the cpu online/offline events (eg, CPU_ONLINE notification
257-
instead of CPU_ONLINE_FROZEN) which in turn will lead to execution of
258-
inappropriate code by the callbacks registered for such CPU hotplug events.
255+
operation in progress. Hence, the cpuhp_tasks_frozen variable will not
256+
reflect the frozen state and the CPU hotplug callbacks which evaluate
257+
that variable might execute the wrong code path.
259258

260259
2. If a regular CPU hotplug stress test happens to race with the freezer due
261260
to a suspend operation in progress at the same time, then we could hit the

include/linux/cpu.h

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,17 @@ extern void unregister_cpu(struct cpu *cpu);
5656
extern ssize_t arch_cpu_probe(const char *, size_t);
5757
extern ssize_t arch_cpu_release(const char *, size_t);
5858
#endif
59-
struct notifier_block;
60-
61-
#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */
62-
#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */
63-
#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
64-
#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
65-
* lock is dropped */
66-
#define CPU_BROKEN 0x000B /* CPU (unsigned)v did not die properly,
67-
* perhaps due to preemption. */
68-
69-
/* Used for CPU hotplug events occurring while tasks are frozen due to a suspend
70-
* operation in progress
59+
60+
/*
61+
* These states are not related to the core CPU hotplug mechanism. They are
62+
* used by various (sub)architectures to track internal state
7163
*/
72-
#define CPU_TASKS_FROZEN 0x0010
73-
74-
#define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN)
75-
#define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN)
76-
#define CPU_UP_CANCELED_FROZEN (CPU_UP_CANCELED | CPU_TASKS_FROZEN)
77-
#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
78-
#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
79-
#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
64+
#define CPU_ONLINE 0x0002 /* CPU is up */
65+
#define CPU_UP_PREPARE 0x0003 /* CPU coming up */
66+
#define CPU_DEAD 0x0007 /* CPU dead */
67+
#define CPU_DEAD_FROZEN 0x0008 /* CPU timed out on unplug */
68+
#define CPU_POST_DEAD 0x0009 /* CPU successfully unplugged */
69+
#define CPU_BROKEN 0x000B /* CPU did not die properly */
8070

8171
#ifdef CONFIG_SMP
8272
extern bool cpuhp_tasks_frozen;

0 commit comments

Comments
 (0)