Skip to content

Commit 4d5755b

Browse files
Davidlohr Buesotorvalds
authored andcommitted
epoll: optimize setting task running after blocking
After waking up a task waiting for an event, we explicitly mark it as TASK_RUNNING (which is necessary as we do the checks for wakeups as TASK_INTERRUPTIBLE). Once running and dealing with actually delivering the events, we're obviously not planning on calling schedule, thus we can relax the implied barrier and simply update the state with __set_current_state(). Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0f3c5aa commit 4d5755b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/eventpoll.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,9 +1639,9 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
16391639

16401640
spin_lock_irqsave(&ep->lock, flags);
16411641
}
1642-
__remove_wait_queue(&ep->wq, &wait);
16431642

1644-
set_current_state(TASK_RUNNING);
1643+
__remove_wait_queue(&ep->wq, &wait);
1644+
__set_current_state(TASK_RUNNING);
16451645
}
16461646
check_events:
16471647
/* Is it worth to try to dig for events ? */

0 commit comments

Comments
 (0)