Skip to content

Commit

Permalink
epoll: move eavail next to the list_empty_careful check
Browse files Browse the repository at this point in the history
This is a no-op change and simply to make the code more coherent.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Soheil Hassas Yeganeh <[email protected]>
Suggested-by: Linus Torvalds <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Reviewed-by: Willem de Bruijn <[email protected]>
Reviewed-by: Khazhismel Kumykov <[email protected]>
Cc: Guantao Liu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
soheilhy authored and torvalds committed Dec 19, 2020
1 parent cccd29b commit e411596
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/eventpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,7 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
if (!eavail)
timed_out = !schedule_hrtimeout_range(to, slack,
HRTIMER_MODE_ABS);
__set_current_state(TASK_RUNNING);

/*
* We were woken up, thus go and try to harvest some events.
Expand All @@ -1837,8 +1838,6 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
eavail = 1;
} while (0);

__set_current_state(TASK_RUNNING);

if (!list_empty_careful(&wait.entry)) {
write_lock_irq(&ep->lock);
/*
Expand Down

0 comments on commit e411596

Please sign in to comment.