public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.6.32-rc6] workqueue: fix race condition in	schedule_on_each_cpu()
Date: Sat, 14 Nov 2009 18:01:52 +0900	[thread overview]
Message-ID: <4AFE7200.5040601@kernel.org> (raw)
In-Reply-To: <20091113153827.GA6475@redhat.com>

Hello, Oleg.

11/14/2009 12:38 AM, Oleg Nesterov wrote:
> A very minor nit, schedule_on_each_cpu() still checks "orig" twice,
> perhaps it makes sense to do
> 
> 	for_each_online_cpu(cpu) {
> 		struct work_struct *work = per_cpu_ptr(works, cpu);
> 
> 		INIT_WORK(work, func);
> 
> 		if (likely(cpu != orig))
> 			schedule_work_on(cpu, work);
> 		else
> 			func(work);
> 	}

The intention was to schedule works on all other cpus first and then
execute it on local cpu so that if it takes some time, it doesn't have
to go through the latency twice.

Thanks.

-- 
tejun

  reply	other threads:[~2009-11-14  9:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-13  9:29 [PATCH 2.6.32-rc6] workqueue: fix race condition in schedule_on_each_cpu() Tejun Heo
2009-11-13  9:33 ` Ingo Molnar
2009-11-13 15:38 ` Oleg Nesterov
2009-11-14  9:01   ` Tejun Heo [this message]
2009-11-14 18:49     ` Oleg Nesterov

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=4AFE7200.5040601@kernel.org \
    --to=tj@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /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