mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] epoll: preserve ordering of events from ovflist
Date: Sat, 2 Mar 2013 07:25:08 +0000	[thread overview]
Message-ID: <20130302072508.GA19297@dcvr.yhbt.net> (raw)

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

             reply	other threads:[~2013-03-02  7:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-02  7:25 Eric Wong [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130302072508.GA19297@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®