[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whRnW3e3g5PkEtH6geVVYZO2MPUH4ZV5a=khePC9evY4g@mail.gmail.com>
Date: Thu, 26 Dec 2024 12:29:55 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Oleg Nesterov <oleg@...hat.com>, WangYuli <wangyuli@...ontech.com>
Cc: linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>, Christian Brauner <brauner@...nel.org>
Subject: Re: [RESEND PATCH] fs/pipe: Introduce a check to skip sleeping
processes during pipe read/write
[ Ugh, removed the crazy cc list with tons of old addresses ]
On Thu, 26 Dec 2024 at 12:13, Oleg Nesterov <oleg@...hat.com> wrote:
>
> I _think_ that
>
> wait_event_whatever(WQ, CONDITION);
>
> vs
>
> CONDITION = 1;
> if (wq_has_sleeper(WQ))
> wake_up_xxx(WQ, ...);
>
> is fine.
Hmm. I guess wq_has_sleeper() does have a memory barrier, so that
worry of mine was wrong.
So the optimization may be valid (the config option definitely is
not), but I think it needs to be explained much better.
I end up being very nervous about this code because we've had bugs in
this area, exactly because people optimize this code for the unixbench
pipe benchmark.
And then very few real loads have that behavior, although there are
some cases where people really use a pipe as a kind of "token
mechanism" (ie GNU make will do that, I think a few others do too).
Linus
Powered by blists - more mailing lists