mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Hillf Danton <dhillf@gmail.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] stop_machine: wake up stopper thread lazily
Date: Wed, 6 Feb 2013 10:52:13 -0800	[thread overview]
Message-ID: <20130206185213.GC2875@htj.dyndns.org> (raw)
In-Reply-To: <CAJd=RBBp1-Q_xDzyUsLLJkh1BWb_X13JAOGxpOjt5Q48_7Q=Ng@mail.gmail.com>

On Wed, Feb 06, 2013 at 08:40:32PM +0800, Hillf Danton wrote:
> 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);

Why does this matter?  It shouldn't matter for correctness.  Is it
meant to be an optimization?  Is it something worth optimizing?  We
hardly ever have contention on cpu stoppers after all and we
shouldn't.

-- 
tejun

      reply	other threads:[~2013-02-06 18:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 12:40 Hillf Danton
2013-02-06 18:52 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130206185213.GC2875@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dhillf@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®