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

From: Oleg Nesterov
Date: Thu Dec 26 2024 - 15:58:40 EST


On 12/26, Linus Torvalds wrote:
>
> [ Ugh, removed the crazy cc list with tons of old addresses ]

thanks.

> So the optimization may be valid

I don't think so, see my initial reply.

unlike wait_event(), __pollwait() + the head/tail checks in pipe_poll()
doesn't have the necessary barriers (at least in theory) afaics. Between
add_wait_queue()->list_add() and LOAD(head/tail).

> (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.

Agreed!

Oleg.