[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJd=RBBp1-Q_xDzyUsLLJkh1BWb_X13JAOGxpOjt5Q48_7Q=Ng@mail.gmail.com>
Date: Wed, 6 Feb 2013 20:40:32 +0800
From: Hillf Danton <dhillf@...il.com>
To: Rusty Russell <rusty@...tcorp.com.au>, Tejun Heo <tj@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>,
LKML <linux-kernel@...r.kernel.org>,
Hillf Danton <dhillf@...il.com>
Subject: [PATCH 3/3] stop_machine: wake up stopper thread lazily
Ring no bell if the stopper thread is busy in handling enqueued works.
Signed-off-by: Hillf Danton <dhillf@...il.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);
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists