Thread View: gmane.linux.kernel
1 messages
1 total messages
Started by Nigel Cunningham
Mon, 19 Sep 2005 13:15
PATCH: Fix race in cpu_down (hotplug cpu)
Author: Nigel Cunningham
Date: Mon, 19 Sep 2005 13:15
Date: Mon, 19 Sep 2005 13:15
31 lines
1122 bytes
1122 bytes
Hi. There is a race condition in taking down a cpu (kernel/cpu.c::cpu_down). A cpu can already be idling when we clear its online flag, and we do not force the idle task to reschedule. This results in __cpu_die timing out. A simple fix is to force the idle task on the cpu going to reschedule. Without the patch below, Suspend2 get into a deadlock at resume time when this issue occurs. I could not complete 20 cycles without seeing the issue. With the patch below, I have completed 75 cycles on the trot without problems. Please apply. Signed-off-by: Nigel Cunningham <ncunningham@cyclades.com> diff -ruNp 9910-hotplug-cpu-race.patch-old/kernel/cpu.c 9910-hotplug-cpu-race.patch-new/kernel/cpu.c --- 9910-hotplug-cpu-race.patch-old/kernel/cpu.c 2005-08-29 10:29:58.000000000 +1000 +++ 9910-hotplug-cpu-race.patch-new/kernel/cpu.c 2005-09-19 12:15:08.000000000 +1000 @@ -126,6 +126,9 @@ int cpu_down(unsigned int cpu) while (!idle_cpu(cpu)) yield(); + /* CPU may have idled before we set its offline flag. */ + set_tsk_need_resched(idle_task(cpu)); + /* This actually kills the CPU. */ __cpu_die(cpu);
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads