[PATCH] splice: only call wake_up_interruptible() when we really have to

__wake_up_common() is pretty heavy in the kernel profiles, this brings
it down to a more acceptable level.

Signed-off-by: Jens Axboe <axboe@suse.de>
This commit is contained in:
Jens Axboe 2006-04-10 09:03:32 +02:00
parent 9aefe431f5
commit c0bd1f650b
1 changed files with 12 additions and 4 deletions

View File

@ -187,6 +187,8 @@ static ssize_t move_to_pipe(struct inode *inode, struct page **pages,
}
if (do_wakeup) {
smp_mb();
if (waitqueue_active(PIPE_WAIT(*inode)))
wake_up_interruptible_sync(PIPE_WAIT(*inode));
kill_fasync(PIPE_FASYNC_READERS(*inode), SIGIO,
POLL_IN);
@ -201,6 +203,8 @@ static ssize_t move_to_pipe(struct inode *inode, struct page **pages,
mutex_unlock(PIPE_MUTEX(*inode));
if (do_wakeup) {
smp_mb();
if (waitqueue_active(PIPE_WAIT(*inode)))
wake_up_interruptible(PIPE_WAIT(*inode));
kill_fasync(PIPE_FASYNC_READERS(*inode), SIGIO, POLL_IN);
}
@ -600,6 +604,8 @@ static ssize_t move_from_pipe(struct inode *inode, struct file *out,
}
if (do_wakeup) {
smp_mb();
if (waitqueue_active(PIPE_WAIT(*inode)))
wake_up_interruptible_sync(PIPE_WAIT(*inode));
kill_fasync(PIPE_FASYNC_WRITERS(*inode),SIGIO,POLL_OUT);
do_wakeup = 0;
@ -611,6 +617,8 @@ static ssize_t move_from_pipe(struct inode *inode, struct file *out,
mutex_unlock(PIPE_MUTEX(*inode));
if (do_wakeup) {
smp_mb();
if (waitqueue_active(PIPE_WAIT(*inode)))
wake_up_interruptible(PIPE_WAIT(*inode));
kill_fasync(PIPE_FASYNC_WRITERS(*inode), SIGIO, POLL_OUT);
}