lkml.org 
[lkml]   [2010]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2.6.36-rc7] memory_hotplug: drop spurious calls to flush_scheduled_work()
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.
*/
int schedule_on_each_cpu(work_func_t func)
{

\
 
 \ /
  Last update: 2010-10-18 11:47    [W:0.204 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site