Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Nam Cao <namcao@linutronix.de>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>,
	Soheil Hassas Yeganeh <soheil@google.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	Shuah Khan <shuah@kernel.org>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Khazhismel Kumykov <khazhy@google.com>,
	Willem de Bruijn <willemb@google.com>,
	Eric Dumazet <edumazet@google.com>, Jens Axboe <axboe@kernel.dk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/2] eventpoll: Fix epoll_wait() report false negative
Date: Mon, 25 May 2026 14:19:24 +0200	[thread overview]
Message-ID: <87pl2jisvn.fsf@yellow.woof> (raw)
In-Reply-To: <CAGudoHFGHsuGUXmefSrGfOkdcoPJnC5a1qbjc9_G4guC4LvJgQ@mail.gmail.com>

Mateusz Guzik <mjguzik@gmail.com> writes:
> Apologies for late reply.

No problem. Your comment is welcomed, but I was actually waiting to see
if my testing comes back with anything suspicious.

> The diff reads ok to me, but I would consider not looping in case of
> seq mismatch.

You mean something like below?

static inline int ep_events_available(struct eventpoll *ep)
{
        unsigned int seq = read_seqcount_begin(&ep->seq);

        return !list_empty_careful(&ep->rdllist) ||
               READ_ONCE(ep->ovflist) != EP_UNACTIVE_PTR ||
               read_seqcount_retry(&ep->seq, seq);
}

Looping almost never happens, so I don't think it makes any
difference. But sure, it is a bit shorter.

> So does it solve the problem?

Yes it does.

> I think a somewhat of a blocker here would be to bench the thing -- I
> would expect some slowdown compared to stock kernel but should be
> still be faster than the previously proposed patch.

I expect the slowdown to be in the noise, but I will do a benchmark.

Nam

  reply	other threads:[~2026-05-25 12:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1752824628.git.namcao@linutronix.de>
2025-07-18  7:52 ` [PATCH 2/2] eventpoll: Fix epoll_wait() report false negative Nam Cao
2025-07-18  8:38   ` Soheil Hassas Yeganeh
2025-07-18  8:59     ` Nam Cao
2026-04-29  6:54       ` Christian Brauner
2026-04-29  7:27         ` Nam Cao
2026-04-29 15:34           ` Mateusz Guzik
2026-05-03 13:24             ` Nam Cao
2026-05-21 12:38               ` Mateusz Guzik
2026-05-25 12:19                 ` Nam Cao [this message]
2026-05-04 12:00         ` David Laight
2025-09-17 12:49   ` Mateusz Guzik
2025-09-17 13:41     ` Nam Cao
2025-09-17 16:05       ` Mateusz Guzik
2025-09-17 16:08         ` Mateusz Guzik
2025-09-17 18:03           ` Khazhy Kumykov
2025-09-17 22:28             ` Khazhy Kumykov
2025-09-17 22:38               ` Mateusz Guzik
2025-09-22  6:26                 ` Nam Cao
2025-09-20 14:42         ` David Laight
2025-09-20 14:45           ` Mateusz Guzik

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=87pl2jisvn.fsf@yellow.woof \
    --to=namcao@linutronix.de \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=dave@stgolabs.net \
    --cc=edumazet@google.com \
    --cc=jack@suse.cz \
    --cc=khazhy@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --cc=shuah@kernel.org \
    --cc=soheil@google.com \
    --cc=stable@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willemb@google.com \
    /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