diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-10 18:48:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-10 18:48:53 -0400 |
commit | 082b63ae45e7d14e15995dedd782ec7344596fb2 (patch) | |
tree | b5e52149ecd6ac4a8951abbcf4bef5101bc60479 /kernel/sched.c | |
parent | 99e97b860e14c64760855198e91d1166697131a7 (diff) | |
parent | 50fa610a3b6ba7cf91d7a92229177dfaff2b81a1 (diff) |
Merge branch 'sched-docs-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-docs-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
sched: Document memory barriers implied by sleep/wake-up primitives
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 228acae8821f..c3c04e256560 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -2464,6 +2464,17 @@ out: | |||
2464 | return success; | 2464 | return success; |
2465 | } | 2465 | } |
2466 | 2466 | ||
2467 | /** | ||
2468 | * wake_up_process - Wake up a specific process | ||
2469 | * @p: The process to be woken up. | ||
2470 | * | ||
2471 | * Attempt to wake up the nominated process and move it to the set of runnable | ||
2472 | * processes. Returns 1 if the process was woken up, 0 if it was already | ||
2473 | * running. | ||
2474 | * | ||
2475 | * It may be assumed that this function implies a write memory barrier before | ||
2476 | * changing the task state if and only if any tasks are woken up. | ||
2477 | */ | ||
2467 | int wake_up_process(struct task_struct *p) | 2478 | int wake_up_process(struct task_struct *p) |
2468 | { | 2479 | { |
2469 | return try_to_wake_up(p, TASK_ALL, 0); | 2480 | return try_to_wake_up(p, TASK_ALL, 0); |
@@ -5425,6 +5436,9 @@ static void __wake_up_common(wait_queue_head_t *q, unsigned int mode, | |||
5425 | * @mode: which threads | 5436 | * @mode: which threads |
5426 | * @nr_exclusive: how many wake-one or wake-many threads to wake up | 5437 | * @nr_exclusive: how many wake-one or wake-many threads to wake up |
5427 | * @key: is directly passed to the wakeup function | 5438 | * @key: is directly passed to the wakeup function |
5439 | * | ||
5440 | * It may be assumed that this function implies a write memory barrier before | ||
5441 | * changing the task state if and only if any tasks are woken up. | ||
5428 | */ | 5442 | */ |
5429 | void __wake_up(wait_queue_head_t *q, unsigned int mode, | 5443 | void __wake_up(wait_queue_head_t *q, unsigned int mode, |
5430 | int nr_exclusive, void *key) | 5444 | int nr_exclusive, void *key) |
@@ -5463,6 +5477,9 @@ void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key) | |||
5463 | * with each other. This can prevent needless bouncing between CPUs. | 5477 | * with each other. This can prevent needless bouncing between CPUs. |
5464 | * | 5478 | * |
5465 | * On UP it can prevent extra preemption. | 5479 | * On UP it can prevent extra preemption. |
5480 | * | ||
5481 | * It may be assumed that this function implies a write memory barrier before | ||
5482 | * changing the task state if and only if any tasks are woken up. | ||
5466 | */ | 5483 | */ |
5467 | void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, | 5484 | void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, |
5468 | int nr_exclusive, void *key) | 5485 | int nr_exclusive, void *key) |
@@ -5499,6 +5516,9 @@ EXPORT_SYMBOL_GPL(__wake_up_sync); /* For internal use only */ | |||
5499 | * awakened in the same order in which they were queued. | 5516 | * awakened in the same order in which they were queued. |
5500 | * | 5517 | * |
5501 | * See also complete_all(), wait_for_completion() and related routines. | 5518 | * See also complete_all(), wait_for_completion() and related routines. |
5519 | * | ||
5520 | * It may be assumed that this function implies a write memory barrier before | ||
5521 | * changing the task state if and only if any tasks are woken up. | ||
5502 | */ | 5522 | */ |
5503 | void complete(struct completion *x) | 5523 | void complete(struct completion *x) |
5504 | { | 5524 | { |
@@ -5516,6 +5536,9 @@ EXPORT_SYMBOL(complete); | |||
5516 | * @x: holds the state of this particular completion | 5536 | * @x: holds the state of this particular completion |
5517 | * | 5537 | * |
5518 | * This will wake up all threads waiting on this particular completion event. | 5538 | * This will wake up all threads waiting on this particular completion event. |
5539 | * | ||
5540 | * It may be assumed that this function implies a write memory barrier before | ||
5541 | * changing the task state if and only if any tasks are woken up. | ||
5519 | */ | 5542 | */ |
5520 | void complete_all(struct completion *x) | 5543 | void complete_all(struct completion *x) |
5521 | { | 5544 | { |