Re: [PATCH 1/2] pipe: change pipe_write() to never add a zero-sized buffer

K Prateek Nayak
2025-02-09T23:39:26Z

Hello Oleg,

On 2/10/2025 12:45 AM, Oleg Nesterov wrote:
> On 02/09, Linus Torvalds wrote:
>>
>> On Sun, 9 Feb 2025 at 10:45, Oleg Nesterov <oleg@redhat.com> wrote:
>>>
>>> Again, lets look eat_empty_buffer().
>>>
>>> The comment says "maybe it's empty" but how/why can this happen ?
>>
>> WHY DO YOU CARE?
>
> Because it looks unclear/confusing, and I think it can confuse other
> readers of this code. Especially after 1/2.
>
>> So here's the deal: either you
> ...
>> (b) you DON'T convince yourself that that is true, and you leave
>> eat_empty_buffer() alone.
>
> Yes, I failed to convince myself that fs/splice.c can never add an
> empty bufer. Although it seems to me it should not.
>
>> In contrast, the "eat_empty_buffer()" case just saying "if it's an
>> empty buffer, it doesn't satisfy my needs, so I'll just release the
>> empty buffer and go on".
>
> ... without wakeup_pipe_writers().
>
> OK, nevermind, I see your point even if I do not 100% agree.
>
> I'll send v2 without WARN_ON() and without 2/2.

Went ahead and tested that version on top of mainline with your
previous change to skip updating {a,c,m}time, here are the results:

==================================================================
Test : sched-messaging
Units : Normalized time in seconds
Interpretation: Lower is better
Statistic : AMean
==================================================================
Case: mainline + no-acm_time[pct imp](CV) patched[pct imp](CV)
1-groups 1.00 [ -0.00]( 7.19) 0.95 [ 4.90](12.39)
2-groups 1.00 [ -0.00]( 3.54) 1.02 [ -1.92]( 6.55)
4-groups 1.00 [ -0.00]( 2.78) 1.01 [ -0.85]( 2.18)
8-groups 1.00 [ -0.00]( 1.04) 0.99 [ 0.63]( 0.77)
16-groups 1.00 [ -0.00]( 1.02) 1.00 [ -0.26]( 0.98)

I don't see any regression / improvements from a performance standpoint
on my 3rd Generation EPYC system (2 x 64C/128T. boost on, C2 disabled)
Feel free to include:

Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>

>
> Oleg.
>

--
Thanks and Regards,
Prateek