1 --- linux-2.6.28.orig/kernel/sched_bfs.c 2011-06-18 18:46:15.009219526 +0200
2 +++ linux-2.6.28.new/kernel/sched_bfs.c 2011-06-18 19:06:34.087896512 +0200
3 @@ -229,9 +229,6 @@ struct rq {
4 struct sched_info rq_sched_info;
6 /* sys_sched_yield() stats */
7 - unsigned int yld_exp_empty;
8 - unsigned int yld_act_empty;
9 - unsigned int yld_both_empty;
10 unsigned int yld_count;
12 /* schedule() stats */
13 @@ -2585,6 +2582,46 @@ void __wake_up_locked(wait_queue_head_t
14 __wake_up_common(q, mode, 1, 0, NULL);
17 +void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key)
19 + __wake_up_common(q, mode, 1, 0, key);
23 + * __wake_up_sync_key - wake up threads blocked on a waitqueue.
25 + * @mode: which threads
26 + * @nr_exclusive: how many wake-one or wake-many threads to wake up
27 + * @key: opaque value to be passed to wakeup targets
29 + * The sync wakeup differs that the waker knows that it will schedule
30 + * away soon, so while the target thread will be woken up, it will not
31 + * be migrated to another CPU - ie. the two threads are 'synchronised'
32 + * with each other. This can prevent needless bouncing between CPUs.
34 + * On UP it can prevent extra preemption.
36 + * It may be assumed that this function implies a write memory barrier before
37 + * changing the task state if and only if any tasks are woken up.
39 +void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode,
40 + int nr_exclusive, void *key)
42 + unsigned long flags;
48 + if (unlikely(!nr_exclusive))
51 + spin_lock_irqsave(&q->lock, flags);
52 + __wake_up_common(q, mode, nr_exclusive, sync, key);
53 + spin_unlock_irqrestore(&q->lock, flags);
55 +EXPORT_SYMBOL_GPL(__wake_up_sync_key);
58 * __wake_up_sync - wake up threads blocked on a waitqueue.
60 @@ -2615,6 +2652,18 @@ void __wake_up_sync(wait_queue_head_t *q
62 EXPORT_SYMBOL_GPL(__wake_up_sync); /* For internal use only */
65 + * complete: - signals a single thread waiting on this completion
66 + * @x: holds the state of this particular completion
68 + * This will wake up a single thread waiting on this completion. Threads will be
69 + * awakened in the same order in which they were queued.
71 + * See also complete_all(), wait_for_completion() and related routines.
73 + * It may be assumed that this function implies a write memory barrier before
74 + * changing the task state if and only if any tasks are woken up.
76 void complete(struct completion *x)
79 @@ -2626,6 +2675,15 @@ void complete(struct completion *x)
81 EXPORT_SYMBOL(complete);
84 + * complete_all: - signals all threads waiting on this completion
85 + * @x: holds the state of this particular completion
87 + * This will wake up all threads waiting on this particular completion event.
89 + * It may be assumed that this function implies a write memory barrier before
90 + * changing the task state if and only if any tasks are woken up.
92 void complete_all(struct completion *x)
95 @@ -2677,12 +2735,31 @@ wait_for_common(struct completion *x, lo
100 + * wait_for_completion: - waits for completion of a task
101 + * @x: holds the state of this particular completion
103 + * This waits to be signaled for completion of a specific task. It is NOT
104 + * interruptible and there is no timeout.
106 + * See also similar routines (i.e. wait_for_completion_timeout()) with timeout
107 + * and interrupt capability. Also see complete().
109 void __sched wait_for_completion(struct completion *x)
111 wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_UNINTERRUPTIBLE);
113 EXPORT_SYMBOL(wait_for_completion);
116 + * wait_for_completion_timeout: - waits for completion of a task (w/timeout)
117 + * @x: holds the state of this particular completion
118 + * @timeout: timeout value in jiffies
120 + * This waits for either a completion of a specific task to be signaled or for a
121 + * specified timeout to expire. The timeout is in jiffies. It is not
124 unsigned long __sched
125 wait_for_completion_timeout(struct completion *x, unsigned long timeout)
127 @@ -2690,6 +2767,13 @@ wait_for_completion_timeout(struct compl
129 EXPORT_SYMBOL(wait_for_completion_timeout);
132 + * wait_for_completion_interruptible: - waits for completion of a task (w/intr)
133 + * @x: holds the state of this particular completion
135 + * This waits for completion of a specific task to be signaled. It is
138 int __sched wait_for_completion_interruptible(struct completion *x)
140 long t = wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_INTERRUPTIBLE);
141 @@ -2699,6 +2783,14 @@ int __sched wait_for_completion_interrup
143 EXPORT_SYMBOL(wait_for_completion_interruptible);
146 + * wait_for_completion_interruptible_timeout: - waits for completion (w/(to,intr))
147 + * @x: holds the state of this particular completion
148 + * @timeout: timeout value in jiffies
150 + * This waits for either a completion of a specific task to be signaled or for a
151 + * specified timeout to expire. It is interruptible. The timeout is in jiffies.
153 unsigned long __sched
154 wait_for_completion_interruptible_timeout(struct completion *x,
155 unsigned long timeout)
156 @@ -2707,6 +2799,13 @@ wait_for_completion_interruptible_timeou
158 EXPORT_SYMBOL(wait_for_completion_interruptible_timeout);
161 + * wait_for_completion_killable: - waits for completion of a task (killable)
162 + * @x: holds the state of this particular completion
164 + * This waits to be signaled for completion of a specific task. It can be
165 + * interrupted by a kill signal.
167 int __sched wait_for_completion_killable(struct completion *x)
169 long t = wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_KILLABLE);