From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Mel Gorman <mel@csn.ul.ie>
Cc: kosaki.motohiro@jp.fujitsu.com, Tejun Heo <tj@kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Andrew Morton <akpm@linux-foundation.org>,
Wu Fengguang <fengguang.wu@intel.com>,
Michal Hocko <mhocko@suse.cz>
Subject: Re: [PATCH v2.6.36-rc7] memory_hotplug: drop spurious calls to flush_scheduled_work()
Date: Tue, 19 Oct 2010 13:38:18 +0900 (JST) [thread overview]
Message-ID: <20101019133750.A1E6.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20101018094403.GW30667@csn.ul.ie>
> On Fri, Oct 15, 2010 at 05:25:15PM +0200, Tejun Heo wrote:
> > lru_add_drain_all() uses schedule_on_each_cpu() which is synchronous.
> > There is no reason to call flush_scheduled_work() after
> > lru_add_drain_all(). Drop the spurious calls.
> >
>
> This looks correct.
>
> Acked-by: Mel Gorman <mel@csn.ul.ie>
>
> I suspect this call to flush_scheduled_work() existed because it is easy
> to interpret the documentation of schedule_on_each_cpu to mean it is an
> asynchronous call. Maybe something like the following?
>
> ==== CUT HERE ====
> workqueue: Clarify that schedule_on_each_cpu is synchronous
>
> The documentation for schedule_on_each_cpu() states that it calls a function
> on each online CPU from keventd. This can easily be interpreted as an
> asyncronous call because the description does not mention that flush_work
> is called. Clarify that it is synchronous.
>
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> ---
> kernel/workqueue.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index f77afd9..07cba1e 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -2592,13 +2592,15 @@ int schedule_delayed_work_on(int cpu,
> EXPORT_SYMBOL(schedule_delayed_work_on);
>
> /**
> - * schedule_on_each_cpu - call a function on each online CPU from keventd
> + * schedule_on_each_cpu - Call a function on each online CPU via keventd and wait for completion
> * @func: the function to call
> *
> + * schedule_on_each_cpu executes a given callback function on each CPU via keventd
> + * and blocks until each callback has completed. schedule_on_each_cpu() is very
> + * slow.
> + *
> * Returns zero on success.
> * Returns -ve errno on failure.
> - *
> - * schedule_on_each_cpu() is very slow.
Nice!
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
next prev parent reply other threads:[~2010-10-19 4:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-15 15:25 Tejun Heo
2010-10-18 0:01 ` KAMEZAWA Hiroyuki
2010-10-18 5:03 ` Tejun Heo
2010-10-18 23:58 ` KAMEZAWA Hiroyuki
2010-10-19 9:19 ` Tejun Heo
2010-10-18 5:23 ` Minchan Kim
2010-10-18 9:44 ` Mel Gorman
2010-10-19 4:38 ` KOSAKI Motohiro [this message]
2010-10-19 9:18 ` [PATCH wq#for-next] workqueue: Clarify that schedule_on_each_cpu is synchronous Tejun Heo
2010-10-20 0:20 ` KAMEZAWA Hiroyuki
2010-10-20 0:54 ` Wu Fengguang
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=20101019133750.A1E6.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=mhocko@suse.cz \
--cc=tj@kernel.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
all inboxes | Powered by JetHome®