diff -urN linux-2.4.19-pre7-ac2/fs/pipe.c linux/fs/pipe.c --- linux-2.4.19-pre7-ac2/fs/pipe.c Fri Apr 19 20:50:30 2002 +++ linux/fs/pipe.c Fri Apr 19 20:52:12 2002 @@ -115,7 +115,7 @@ * writers synchronously that there is more * room. */ - wake_up_interruptible_sync(PIPE_WAIT(*inode)); + wake_up_interruptible(PIPE_WAIT(*inode)); if (!PIPE_EMPTY(*inode)) BUG(); goto do_more_read; @@ -215,7 +215,7 @@ * is going to give up this CPU, so it doesnt have * to do idle reschedules. */ - wake_up_interruptible_sync(PIPE_WAIT(*inode)); + wake_up_interruptible(PIPE_WAIT(*inode)); PIPE_WAITING_WRITERS(*inode)++; pipe_wait(inode); PIPE_WAITING_WRITERS(*inode)--; diff -urN linux-2.4.19-pre7-ac2/include/linux/sched.h linux/include/linux/sched.h --- linux-2.4.19-pre7-ac2/include/linux/sched.h Fri Apr 19 20:50:52 2002 +++ linux/include/linux/sched.h Fri Apr 19 20:52:12 2002 @@ -577,7 +577,6 @@ #define CURRENT_TIME (xtime.tv_sec) extern void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr)); -extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr)); extern void FASTCALL(sleep_on(wait_queue_head_t *q)); extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q, signed long timeout)); @@ -591,13 +590,9 @@ #define wake_up(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1) #define wake_up_nr(x, nr) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, nr) #define wake_up_all(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 0) -#define wake_up_sync(x) __wake_up_sync((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1) -#define wake_up_sync_nr(x, nr) __wake_up_sync((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, nr) #define wake_up_interruptible(x) __wake_up((x),TASK_INTERRUPTIBLE, 1) #define wake_up_interruptible_nr(x, nr) __wake_up((x),TASK_INTERRUPTIBLE, nr) #define wake_up_interruptible_all(x) __wake_up((x),TASK_INTERRUPTIBLE, 0) -#define wake_up_interruptible_sync(x) __wake_up_sync((x),TASK_INTERRUPTIBLE, 1) -#define wake_up_interruptible_sync_nr(x) __wake_up_sync((x),TASK_INTERRUPTIBLE, nr) asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struct rusage * ru); extern int in_group_p(gid_t); diff -urN linux-2.4.19-pre7-ac2/kernel/ksyms.c linux/kernel/ksyms.c --- linux-2.4.19-pre7-ac2/kernel/ksyms.c Fri Apr 19 20:50:50 2002 +++ linux/kernel/ksyms.c Fri Apr 19 20:52:12 2002 @@ -434,7 +434,6 @@ /* process management */ EXPORT_SYMBOL(complete_and_exit); EXPORT_SYMBOL(__wake_up); -EXPORT_SYMBOL(__wake_up_sync); EXPORT_SYMBOL(wake_up_process); EXPORT_SYMBOL(sleep_on); EXPORT_SYMBOL(sleep_on_timeout); diff -urN linux-2.4.19-pre7-ac2/kernel/sched.c linux/kernel/sched.c --- linux-2.4.19-pre7-ac2/kernel/sched.c Fri Apr 19 20:50:50 2002 +++ linux/kernel/sched.c Fri Apr 19 20:53:09 2002 @@ -321,7 +321,7 @@ * "current->state = TASK_RUNNING" to mark yourself runnable * without the overhead of this. */ -static int try_to_wake_up(task_t * p, int synchronous) +static int try_to_wake_up(task_t * p) { unsigned long flags; int success = 0; @@ -341,7 +341,7 @@ int wake_up_process(task_t * p) { - return try_to_wake_up(p, 0); + return try_to_wake_up(p); } void wake_up_forked_process(task_t * p) @@ -826,44 +826,34 @@ * started to run but is not in state TASK_RUNNING. try_to_wake_up() returns * zero in this (rare) case, and we handle it by continuing to scan the queue. */ -static inline void __wake_up_common (wait_queue_head_t *q, unsigned int mode, - int nr_exclusive, const int sync) +static inline void __wake_up_common(wait_queue_head_t *q, unsigned int mode, + int nr_exclusive) { struct list_head *tmp; + unsigned int state; + wait_queue_t *curr; task_t *p; - list_for_each(tmp,&q->task_list) { - unsigned int state; - wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list); - + list_for_each(tmp, &q->task_list) { + curr = list_entry(tmp, wait_queue_t, task_list); p = curr->task; state = p->state; - if ((state & mode) && - try_to_wake_up(p, sync) && - ((curr->flags & WQ_FLAG_EXCLUSIVE) && - !--nr_exclusive)) - break; + if ((state & mode) && try_to_wake_up(p) && + ((curr->flags & WQ_FLAG_EXCLUSIVE) && !--nr_exclusive)) + break; } } -void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr) +void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr_exclusive) { - if (q) { - unsigned long flags; - wq_read_lock_irqsave(&q->lock, flags); - __wake_up_common(q, mode, nr, 0); - wq_read_unlock_irqrestore(&q->lock, flags); - } -} + unsigned long flags; -void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr) -{ - if (q) { - unsigned long flags; - wq_read_lock_irqsave(&q->lock, flags); - __wake_up_common(q, mode, nr, 1); - wq_read_unlock_irqrestore(&q->lock, flags); - } + if (unlikely(!q)) + return; + + wq_read_lock_irqsave(&q->lock, flags); + __wake_up_common(q, mode, nr_exclusive); + wq_read_unlock_irqrestore(&q->lock, flags); } void complete(struct completion *x) @@ -872,7 +862,7 @@ wq_write_lock_irqsave(&x->wait.lock, flags); x->done++; - __wake_up_common(&x->wait, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1, 0); + __wake_up_common(&x->wait, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1); wq_write_unlock_irqrestore(&x->wait.lock, flags); }