Commit abc610e0 authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by Linus Torvalds
Browse files

fs/epoll: avoid barrier after an epoll_wait(2) timeout

Upon timeout, we can just exit out of the loop, without the cost of the
changing the task's state with an smp_store_mb call.  Just exit out of
the loop and be done - setting the task state afterwards will be, of
course, redundant.

[ forgotten fixlets]

Signed-off-by: default avatarDavidlohr Bueso <>
Reviewed-by: default avatarAndrew Morton <>
Cc: Al Viro <>
Cc: Davidlohr Bueso <>
Cc: Jason Baron <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent c5a282e9
......@@ -1820,15 +1820,19 @@ fetch_events:
res = -EINTR;
if (ep_events_available(ep) || timed_out)
eavail = ep_events_available(ep);
if (eavail)
if (signal_pending(current)) {
res = -EINTR;
if (!schedule_hrtimeout_range(to, slack, HRTIMER_MODE_ABS))
if (!schedule_hrtimeout_range(to, slack, HRTIMER_MODE_ABS)) {
timed_out = 1;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment