From: Soheil Hassas Yeganeh Date: Fri, 18 Dec 2020 22:01:54 +0000 (-0800) Subject: epoll: move eavail next to the list_empty_careful check X-Git-Tag: v5.11-rc1~61^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e411596d48b5b77632deb91afcbc3185b9b658cb;p=thirdparty%2Fkernel%2Flinux.git epoll: move eavail next to the list_empty_careful check This is a no-op change and simply to make the code more coherent. Link: https://lkml.kernel.org/r/20201106231635.3528496-5-soheil.kdev@gmail.com Signed-off-by: Soheil Hassas Yeganeh Suggested-by: Linus Torvalds Reviewed-by: Eric Dumazet Reviewed-by: Willem de Bruijn Reviewed-by: Khazhismel Kumykov Cc: Guantao Liu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/eventpoll.c b/fs/eventpoll.c index b9d87745fae62..d8eef21575871 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1828,6 +1828,7 @@ fetch_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. @@ -1837,8 +1838,6 @@ fetch_events: eavail = 1; } while (0); - __set_current_state(TASK_RUNNING); - if (!list_empty_careful(&wait.entry)) { write_lock_irq(&ep->lock); /*