lkml.org 
[lkml]   [2013]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 3/3] stop_machine: wake up stopper thread lazily
From
Ring no bell if the stopper thread is busy in handling enqueued works.

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

--- a/kernel/stop_machine.c Wed Feb 6 20:05:44 2013
+++ b/kernel/stop_machine.c Wed Feb 6 20:06:56 2013
@@ -72,8 +72,10 @@ static void cpu_stop_queue_work(struct c
spin_lock_irqsave(&stopper->lock, flags);

if (stopper->enabled) {
+ int wakeup = list_empty(&stopper->works);
list_add_tail(&work->list, &stopper->works);
- wake_up_process(stopper->thread);
+ if (wakeup)
+ wake_up_process(stopper->thread);
} else
cpu_stop_signal_done(work->done, false, 0);

--

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