All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.30] schedule_work() documentation improvements
@ 2009-07-30 17:00 Bart Van Assche
  2009-08-04 14:15 ` [tip:core/cleanups] workqueues: Improve schedule_work() documentation tip-bot for Bart Van Assche
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2009-07-30 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Ingo Molnar

Two important aspects of the schedule_work() function are not yet documented:
- that it is allowed to pass a struct work_struct * to this function that
  is already on the kernel-global workqueue;
- the meaning of its return value.
The patch below documents both aspects.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>

diff -uprN orig/linux-2.6.30/kernel/workqueue.c linux-2.6.30/kernel/workqueue.c
--- orig/linux-2.6.30/kernel/workqueue.c	2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30/kernel/workqueue.c	2009-07-30 18:58:07.000000000 +0200
@@ -603,7 +603,11 @@ static struct workqueue_struct *keventd_
  * schedule_work - put work task in global workqueue
  * @work: job to be done
  *
- * This puts a job in the kernel-global workqueue.
+ * Returns zero if @work was already on the kernel-global workqueue and
+ * non-zero otherwise.
+ *
+ * This puts a job in the kernel-global workqueue if it was not already queued
+ * and leaves it in the same position on the kernel-global workqueue otherwise.
  */
 int schedule_work(struct work_struct *work)
 {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:core/cleanups] workqueues: Improve schedule_work() documentation
  2009-07-30 17:00 [PATCH 2.6.30] schedule_work() documentation improvements Bart Van Assche
@ 2009-08-04 14:15 ` tip-bot for Bart Van Assche
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Bart Van Assche @ 2009-08-04 14:15 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, akpm, gregkh, tglx, bart.vanassche, mingo

Commit-ID:  5b0f437df0a3e374d26ad533eb78fe64744f55a8
Gitweb:     http://git.kernel.org/tip/5b0f437df0a3e374d26ad533eb78fe64744f55a8
Author:     Bart Van Assche <bart.vanassche@gmail.com>
AuthorDate: Thu, 30 Jul 2009 19:00:53 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 4 Aug 2009 15:21:16 +0200

workqueues: Improve schedule_work() documentation

Two important aspects of the schedule_work() function are not
yet documented:

 - that it is allowed to pass a struct work_struct * to this
   function that is already on the kernel-global workqueue;

 - the meaning of its return value.

The patch below documents both aspects.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Cc: "Greg Kroah-Hartman" <gregkh@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <200907301900.54202.bart.vanassche@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 kernel/workqueue.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 0668795..3c44b56 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -600,7 +600,12 @@ static struct workqueue_struct *keventd_wq __read_mostly;
  * schedule_work - put work task in global workqueue
  * @work: job to be done
  *
- * This puts a job in the kernel-global workqueue.
+ * Returns zero if @work was already on the kernel-global workqueue and
+ * non-zero otherwise.
+ *
+ * This puts a job in the kernel-global workqueue if it was not already
+ * queued and leaves it in the same position on the kernel-global
+ * workqueue otherwise.
  */
 int schedule_work(struct work_struct *work)
 {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-04 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-30 17:00 [PATCH 2.6.30] schedule_work() documentation improvements Bart Van Assche
2009-08-04 14:15 ` [tip:core/cleanups] workqueues: Improve schedule_work() documentation tip-bot for Bart Van Assche

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.