All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG() the kernel via the hotplug target sysfs file
@ 2017-06-02 14:47 Sebastian Andrzej Siewior
  0 siblings, 0 replies; only message in thread
From: Sebastian Andrzej Siewior @ 2017-06-02 14:47 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Ingo Molnar, linux-kernel

It is possible to BUG() the kernel via the hotplug target interface via:
|echo 91 > /sys/devices/system/cpu/cpu7/hotplug/target
| Unregister pv shared memory for cpu 7
| ------------[ cut here ]------------
| kernel BUG at kernel/cpu.c:747!

which is:

|  void cpuhp_report_idle_dead(void)
| {
|         struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
| 
=>       BUG_ON(st->state != CPUHP_AP_OFFLINE);
| …
| }

So the states are:
 89: idle:dead
 90: ap:offline
 91: sched:starting
 92: RCU/tree:dying
132: ap:online
133: cpu:teardown

and cpu:teardown (takedown_cpu()) invokes:
 cpu_stopper_thread()
 multi_cpu_stop()
 take_cpu_down()
 native_cpu_disable()
 cpu_disable_common()

which clears the CPU from cpu_online_mask. This means, as things are
now, we can't stop at any state between cpu:teardown and idle:dead.

Sebastian

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-02 14:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-02 14:47 BUG() the kernel via the hotplug target sysfs file Sebastian Andrzej Siewior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.