Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

[dave@stgolabs.net: forgotten fixlets]
Link: http://lkml.kernel.org/r/20181109155258.jxcr4t2pnz6zqct3@linux-r8p5
Link: http://lkml.kernel.org/r/20181108051006.18751-7-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: Jason Baron <jbaron@akamai.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Davidlohr Bueso and committed by
Linus Torvalds
abc610e0 c5a282e9

+6 -2
+6 -2
fs/eventpoll.c
··· 1820 1820 res = -EINTR; 1821 1821 break; 1822 1822 } 1823 - if (ep_events_available(ep) || timed_out) 1823 + 1824 + eavail = ep_events_available(ep); 1825 + if (eavail) 1824 1826 break; 1825 1827 if (signal_pending(current)) { 1826 1828 res = -EINTR; 1827 1829 break; 1828 1830 } 1829 1831 1830 - if (!schedule_hrtimeout_range(to, slack, HRTIMER_MODE_ABS)) 1832 + if (!schedule_hrtimeout_range(to, slack, HRTIMER_MODE_ABS)) { 1831 1833 timed_out = 1; 1834 + break; 1835 + } 1832 1836 } 1833 1837 1834 1838 __set_current_state(TASK_RUNNING);