summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2003-05-18 20:46:29 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-05-18 20:46:29 -0700
commit84205d0528f386e99ec00cd378acb3c4df010643 (patch)
tree927badb4f771092255aeac16756264ae6e091631 /kernel
parentd1347e18678cee1ae7f84e71a12fcfc144402c20 (diff)
[PATCH] sync wakeup on UP
This fixes the scheduler's sync-wakeup code to be consistent on UP as well. Right now there's a behavioral difference between an UP kernel and an SMP kernel running on a UP box: sync wakeups (which are only activated on SMP) can cause a wakeup of a higher prio task, without preemption. On UP kernels this does not happen. This difference in wakeup behavior is bad. This patch activates sync wakeups on UP as well - in the cases sync wakeups are done the waker knows that it will schedule away soon, so this 'delay preemption' decision is correct on UP as well.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index dae28f200eef..a699eb066551 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1414,8 +1414,6 @@ void __wake_up_locked(wait_queue_head_t *q, unsigned int mode)
__wake_up_common(q, mode, 1, 0);
}
-#ifdef CONFIG_SMP
-
/**
* __wake_up - sync- wake up threads blocked on a waitqueue.
* @q: the waitqueue
@@ -1426,6 +1424,8 @@ void __wake_up_locked(wait_queue_head_t *q, unsigned int mode)
* away soon, so while the target thread will be woken up, it will not
* be migrated to another CPU - ie. the two threads are 'synchronized'
* with each other. This can prevent needless bouncing between CPUs.
+ *
+ * On UP it can prevent extra preemption.
*/
void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr_exclusive)
{
@@ -1442,8 +1442,6 @@ void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr_exclusive)
spin_unlock_irqrestore(&q->lock, flags);
}
-#endif
-
void complete(struct completion *x)
{
unsigned long flags;