Re: [RESEND PATCH] fs/pipe: Introduce a check to skip sleeping processes during pipe read/write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ Ugh, removed the crazy cc list with tons of old addresses ]

On Thu, 26 Dec 2024 at 12:13, Oleg Nesterov <oleg@xxxxxxxxxx> 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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux