Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] Add DocBook documentation for workqueue functions

kernel/workqueue.c was omitted from generating kernel documentation. This
adds a new section "Workqueues and Kevents" and adds documentation for some
of the functions.

Some functions in this file already had DocBook-style comments, now they
finally become visible.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Rolf Eike Beer and committed by
Linus Torvalds
0fcb78c2 d75763d2

+57 -4
+3
Documentation/DocBook/kernel-api.tmpl
··· 59 59 !Iinclude/linux/hrtimer.h 60 60 !Ekernel/hrtimer.c 61 61 </sect1> 62 + <sect1><title>Workqueues and Kevents</title> 63 + !Ekernel/workqueue.c 64 + </sect1> 62 65 <sect1><title>Internal Functions</title> 63 66 !Ikernel/exit.c 64 67 !Ikernel/signal.c
+54 -4
kernel/workqueue.c
··· 93 93 spin_unlock_irqrestore(&cwq->lock, flags); 94 94 } 95 95 96 - /* 97 - * Queue work on a workqueue. Return non-zero if it was successfully 98 - * added. 96 + /** 97 + * queue_work - queue work on a workqueue 98 + * @wq: workqueue to use 99 + * @work: work to queue 100 + * 101 + * Returns non-zero if it was successfully added. 99 102 * 100 103 * We queue the work to the CPU it was submitted, but there is no 101 104 * guarantee that it will be processed by that CPU. ··· 131 128 __queue_work(per_cpu_ptr(wq->cpu_wq, cpu), work); 132 129 } 133 130 131 + /** 132 + * queue_delayed_work - queue work on a workqueue after delay 133 + * @wq: workqueue to use 134 + * @work: work to queue 135 + * @delay: number of jiffies to wait before queueing 136 + * 137 + * Returns non-zero if it was successfully added. 138 + */ 134 139 int fastcall queue_delayed_work(struct workqueue_struct *wq, 135 140 struct work_struct *work, unsigned long delay) 136 141 { ··· 161 150 } 162 151 EXPORT_SYMBOL_GPL(queue_delayed_work); 163 152 153 + /** 154 + * queue_delayed_work_on - queue work on specific CPU after delay 155 + * @cpu: CPU number to execute work on 156 + * @wq: workqueue to use 157 + * @work: work to queue 158 + * @delay: number of jiffies to wait before queueing 159 + * 160 + * Returns non-zero if it was successfully added. 161 + */ 164 162 int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, 165 163 struct work_struct *work, unsigned long delay) 166 164 { ··· 295 275 } 296 276 } 297 277 298 - /* 278 + /** 299 279 * flush_workqueue - ensure that any scheduled work has run to completion. 280 + * @wq: workqueue to flush 300 281 * 301 282 * Forces execution of the workqueue and blocks until its completion. 302 283 * This is typically used in driver shutdown handlers. ··· 421 400 kthread_stop(p); 422 401 } 423 402 403 + /** 404 + * destroy_workqueue - safely terminate a workqueue 405 + * @wq: target workqueue 406 + * 407 + * Safely destroy a workqueue. All work currently pending will be done first. 408 + */ 424 409 void destroy_workqueue(struct workqueue_struct *wq) 425 410 { 426 411 int cpu; ··· 452 425 453 426 static struct workqueue_struct *keventd_wq; 454 427 428 + /** 429 + * schedule_work - put work task in global workqueue 430 + * @work: job to be done 431 + * 432 + * This puts a job in the kernel-global workqueue. 433 + */ 455 434 int fastcall schedule_work(struct work_struct *work) 456 435 { 457 436 return queue_work(keventd_wq, work); 458 437 } 459 438 EXPORT_SYMBOL(schedule_work); 460 439 440 + /** 441 + * schedule_delayed_work - put work task in global workqueue after delay 442 + * @work: job to be done 443 + * @delay: number of jiffies to wait 444 + * 445 + * After waiting for a given time this puts a job in the kernel-global 446 + * workqueue. 447 + */ 461 448 int fastcall schedule_delayed_work(struct work_struct *work, unsigned long delay) 462 449 { 463 450 return queue_delayed_work(keventd_wq, work, delay); 464 451 } 465 452 EXPORT_SYMBOL(schedule_delayed_work); 466 453 454 + /** 455 + * schedule_delayed_work_on - queue work in global workqueue on CPU after delay 456 + * @cpu: cpu to use 457 + * @work: job to be done 458 + * @delay: number of jiffies to wait 459 + * 460 + * After waiting for a given time this puts a job in the kernel-global 461 + * workqueue on the specified CPU. 462 + */ 467 463 int schedule_delayed_work_on(int cpu, 468 464 struct work_struct *work, unsigned long delay) 469 465 {