Skip to contentSkip to conversation

3.0.23-rt39 BUG: scheduling while atomic, _cpu_down()

DISCUSSION Frank Rowand 2 participants 3 messages Mar 10, 2012

lore
Share & tools
lore
#0 lore raw

Hi Thomas,
(and Steve, since you've been mucking about in the hotplug code,)

Yet another bit of fallout related to hotplug.

This appears to affect 3.0-rt1, 3.0.23-rt29, and 3.2.9-rt17. (Thus probably all 3.x versions, but I haven't been masochistic enough to check.)

If not defined CONFIG_PREEMPT_RT_FULL then

- hotplug_lock() is a mutex_lock()
- cpu_hotplug_begin() calls hotplug_lock()
- _cpu_down() calls cpu_hotplug_begin() with preemption disabled (disabled by the migrate_disable())

The call to cpu_hotplug_begin() is not in a preempt disabled region until hotplug-use-migrate-disable.patch. This patch moves the preempt_enable() (aka migrate_enable()) from just before calling cpu_hotplug_begin() to after "out_cancel:".

The BUG can be triggered by:

echo 0 > /sys/devices/system/cpu/cpu1/online

-Frank

#1 lore raw
Quoted 10 lines · Frank Rowand

Hi Thomas,
(and Steve, since you've been mucking about in the hotplug code,)

Yet another bit of fallout related to hotplug.

This appears to affect 3.0-rt1, 3.0.23-rt29, and 3.2.9-rt17. (Thus probably all 3.x versions, but I haven't been masochistic enough to check.)

If not defined CONFIG_PREEMPT_RT_FULL then

So you're saying that there's a bug with PREEMPT_RT off?

Quoted 6 lines

- hotplug_lock() is a mutex_lock()
- cpu_hotplug_begin() calls hotplug_lock()
- _cpu_down() calls cpu_hotplug_begin() with preemption disabled (disabled by the migrate_disable())

Quoted 8 lines

The call to cpu_hotplug_begin() is not in a preempt disabled region until hotplug-use-migrate-disable.patch. This patch moves the preempt_enable() (aka migrate_enable()) from just before calling cpu_hotplug_begin() to after "out_cancel:".

The BUG can be triggered by:

echo 0 > /sys/devices/system/cpu/cpu1/online

Note, there's a lot more wrong with hotplug in rt than this. The hotplug code really needs a total rewrite for RT to work with it. It probably should have a total rewrite in mainline anyway.

-- Steve

#2 lore raw
Quoted 6 lines · Steven Rostedt
Quoted 5 lines · Frank Rowand

Hi Thomas,
(and Steve, since you've been mucking about in the hotplug code,)

Yet another bit of fallout related to hotplug.

Quoted 7 lines
Quoted 5 lines

This appears to affect 3.0-rt1, 3.0.23-rt29, and 3.2.9-rt17. (Thus probably all 3.x versions, but I haven't been masochistic enough to check.)

If not defined CONFIG_PREEMPT_RT_FULL then

So you're saying that there's a bug with PREEMPT_RT off?

Yes, that is the problem. But it is due to the RT patches, not present in mainline.

Quoted 10 lines
Quoted 10 lines

- hotplug_lock() is a mutex_lock()
- cpu_hotplug_begin() calls hotplug_lock()
- _cpu_down() calls cpu_hotplug_begin() with preemption disabled (disabled by the migrate_disable())

The call to cpu_hotplug_begin() is not in a preempt disabled region until hotplug-use-migrate-disable.patch. This patch moves the preempt_enable() (aka migrate_enable()) from just before calling cpu_hotplug_begin() to after "out_cancel:".

Quoted 7 lines
Quoted 3 lines

The BUG can be triggered by:

echo 0 > /sys/devices/system/cpu/cpu1/online

Note, there's a lot more wrong with hotplug in rt than this. The hotplug code really needs a total rewrite for RT to work with it. It probably should have a total rewrite in mainline anyway.

Yep, I've been watching all the hotplug related conversations with interest...

-Frank