mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] epoll: preserve ordering of events from ovflist
@ 2013-03-02  7:25 Eric Wong
  2013-03-04  3:05 ` Eric Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Wong @ 2013-03-02  7:25 UTC (permalink / raw)
  To: Davide Libenzi; +Cc: Al Viro, Andrew Morton, linux-fsdevel, linux-kernel

Events arriving in ovflist are stored in LIFO order, so
we should account for that when inserting them into rddlist.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
  I think this can lead to starvation in some rare cases, but I have not
  been able to trigger it.  The window for ovflist insertion is tiny.

 fs/eventpoll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 9fec183..5a1a596 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -598,7 +598,7 @@ static int ep_scan_ready_list(struct eventpoll *ep,
 		 * contain them, and the list_splice() below takes care of them.
 		 */
 		if (!ep_is_linked(&epi->rdllink)) {
-			list_add_tail(&epi->rdllink, &ep->rdllist);
+			list_add(&epi->rdllink, &ep->rdllist);
 			__pm_stay_awake(epi->ws);
 		}
 	}
-- 
Eric Wong

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-08  1:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-02  7:25 [PATCH] epoll: preserve ordering of events from ovflist Eric Wong
2013-03-04  3:05 ` Eric Wong
2013-03-04  3:06   ` [PATCH 1/2] epoll: hoist out duplicated wake up logic Eric Wong
2013-03-04  3:06     ` [PATCH 2/2] epoll: add tracepoints for epitem enqueue/dequeue Eric Wong
2013-03-08  1:32       ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®