From: Oleg Nesterov <oleg@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mani Tofigh via B4 Relay <devnull+mt4022.columbia.edu@kernel.org>,
Breno Leitao <leitao@debian.org>,
Christian Brauner <brauner@kernel.org>,
Mateusz Guzik <mjguzik@gmail.com>,
Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
tz2294@columbia.edu, stable@vger.kernel.org,
Mani Tofigh <mt4022@columbia.edu>
Subject: Re: [PATCH] pipe: keep per-write wakeups for EPOLLEXCLUSIVE consumers
Date: Tue, 17 Nov 2026 21:41:29 +0100 [thread overview]
Message-ID: <avy7-XJkoRyslipt@redhat.com> (raw)
In-Reply-To: <CAHk-=wjqParwoB8wb9KfGVpbwUwvKvObpLOo=XPM0GGfkn3ibw@mail.gmail.com>
On 11/17, Linus Torvalds wrote:
>
> Side note: as part of looking at it, I did look at what it would
> involve in our wait.h infrastructure.
>
> That header isn't _horrible_, but some of it was uglier than needed,
> and adding WQ_FLAG_PRIORITY would have been a huge pain because the
> code unnecessarily special-cases WQ_FLAG_EXCLUSIVE.
>
> So while I threw the rest of my trial patch away, this patch remained
> as a cleanup. It *looks* sane to me, and I think the end result looks
> better and would be more flexible.
>
> For example, it would have allowed just adding a new user of
> ___wait_event() that used WQ_FLAG_PRIORITY to put itself at the head
> of the queue.
...
> -#define ___wait_event(wq_head, condition, state, exclusive, ret, cmd) \
> +#define ___wait_event(wq_head, condition, state, wq_flag, ret, cmd) \
> ({ \
> __label__ __out; \
> struct wait_queue_entry __wq_entry; \
> long __ret = ret; /* explicit shadow */ \
> \
> - init_wait_entry(&__wq_entry, exclusive ? WQ_FLAG_EXCLUSIVE : 0); \
> + init_wait_entry(&__wq_entry, wq_flag); \
> for (;;) { \
> long __int = prepare_to_wait_event(&wq_head, &__wq_entry, state);\
Damn ;) I simply can't resist.
I swear, I was thinking of exactly that same change during our discussion.
So I think it is obviously good and makes sense, but I will try to re-check
it after sleep.
Oleg.
prev parent reply other threads:[~2026-11-17 20:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 21:02 [PATCH] pipe: keep per-write wakeups for EPOLLEXCLUSIVE consumers Mani Tofigh via B4 Relay
2026-11-11 23:34 ` Oleg Nesterov
2026-11-12 10:26 ` Oleg Nesterov
2026-11-12 12:56 ` Oleg Nesterov
2026-11-17 13:27 ` Oleg Nesterov
2026-11-17 16:22 ` Linus Torvalds
2026-11-17 17:25 ` Oleg Nesterov
2026-11-17 17:35 ` Linus Torvalds
2026-11-17 17:58 ` Oleg Nesterov
2026-11-17 19:12 ` Linus Torvalds
2026-11-17 19:48 ` Linus Torvalds
2026-11-17 20:41 ` Oleg Nesterov [this message]
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=avy7-XJkoRyslipt@redhat.com \
--to=oleg@redhat.com \
--cc=brauner@kernel.org \
--cc=devnull+mt4022.columbia.edu@kernel.org \
--cc=jack@suse.cz \
--cc=leitao@debian.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjguzik@gmail.com \
--cc=mt4022@columbia.edu \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tz2294@columbia.edu \
--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