--- wake-one/include/linux/sched.h.~1~ Tue Nov 14 15:46:00 2000 +++ wake-one/include/linux/sched.h Tue Nov 14 15:46:33 2000 @@ -79,6 +79,7 @@ #define TASK_ZOMBIE 4 #define TASK_STOPPED 8 #define TASK_SWAPPING 16 +#define TASK_EXCLUSIVE 32 /* * Scheduling policies --- wake-one/kernel/sched.c.~1~ Tue Nov 14 15:45:56 2000 +++ wake-one/kernel/sched.c Tue Nov 14 15:55:33 2000 @@ -687,7 +687,7 @@ goto move_rr_last; move_rr_back: - switch (prev->state) { + switch (prev->state & ~TASK_EXCLUSIVE) { case TASK_INTERRUPTIBLE: if (signal_pending(prev)) { prev->state = TASK_RUNNING; @@ -852,6 +852,7 @@ { struct task_struct *p; struct wait_queue *head, *next; + int wake_one = 0; if (!q) goto out; @@ -870,6 +871,11 @@ p = next->task; next = next->next; if (p->state & mode) { + if (p->state & TASK_EXCLUSIVE) { + if (wake_one) + continue; + wake_one = 1; + } /* * We can drop the read-lock early if this * is the only/last process. @@ -1179,7 +1185,7 @@ read_lock(&tasklist_lock); for_each_task(p) { if ((p->state == TASK_RUNNING || - p->state == TASK_UNINTERRUPTIBLE || + p->state & TASK_UNINTERRUPTIBLE || p->state == TASK_SWAPPING)) nr += FIXED_1; } --- wake-one/kernel/signal.c.~1~ Tue Nov 14 15:45:59 2000 +++ wake-one/kernel/signal.c Tue Nov 14 15:53:04 2000 @@ -394,7 +394,7 @@ out: spin_unlock_irqrestore(&t->sigmask_lock, flags); - if (t->state == TASK_INTERRUPTIBLE && signal_pending(t)) + if (t->state & TASK_INTERRUPTIBLE && signal_pending(t)) wake_up_process(t); out_nolock: --- wake-one/net/ipv4/tcp.c.~1~ Tue Nov 14 15:45:59 2000 +++ wake-one/net/ipv4/tcp.c Tue Nov 14 15:56:26 2000 @@ -1630,7 +1630,7 @@ add_wait_queue(sk->sleep, &wait); for (;;) { - current->state = TASK_INTERRUPTIBLE; + current->state = TASK_INTERRUPTIBLE | TASK_EXCLUSIVE; release_sock(sk); schedule(); lock_sock(sk);