lkml.org 
[lkml]   [2013]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 2/2] stop_machine: dequeue work before signal completion
From
As checked with BUG_ON in the case of CPU_UP_PREPARE, we have to dequeue
work first for further actions, then stopper reaches sane and clear state.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---

--- a/kernel/stop_machine.c Fri Feb 8 11:22:44 2013
+++ b/kernel/stop_machine.c Fri Feb 8 11:29:40 2013
@@ -342,8 +342,12 @@ static int __cpuinit cpu_stop_cpu_callba
kthread_stop(stopper->thread);
/* drain remaining works */
spin_lock_irq(&stopper->lock);
- list_for_each_entry(work, &stopper->works, list)
+ while (!list_empty(&stopper->works)) {
+ work = list_first_entry(&stopper->works,
+ struct cpu_stop_work, list);
+ list_del_init(&work->list);
cpu_stop_signal_done(work->done, false);
+ }
stopper->enabled = false;
spin_unlock_irq(&stopper->lock);
/* release the stopper */
--

\
 
 \ /
  Last update: 2013-02-08 05:21    [W:0.098 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site