lkml.org 
[lkml]   [2018]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 5/6] fs/epoll: reduce the scope of wq lock in epoll_wait()
Sorry, I just realized I forgot these fixlets when sending the v1.

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index ec14e5bcdaa9..c37729658c03 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -381,7 +381,7 @@ static void ep_nested_calls_init(struct nested_calls *ncalls)
*/
static inline int ep_events_available(struct eventpoll *ep)
{
- return !list_empty(&ep->rdllist) ||
+ return !list_empty_careful(&ep->rdllist) ||
READ_ONCE(ep->ovflist) != EP_UNACTIVE_PTR;
}

@@ -1820,8 +1820,9 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
res = -EINTR;
break;
}
-
- if (ep_events_available(ep))
+
+ eavail = ep_events_available(ep);
+ if (eavail)
break;
if (signal_pending(current)) {
res = -EINTR;
\
 
 \ /
  Last update: 2018-11-09 16:53    [W:0.045 / U:22.324 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site