Re: [linus:master] [fs/pipe] f7f4665dc5: lmbench3.PIPE.bandwidth.MB/sec 18.5% regression
From: Mateusz Guzik
Date: Thu Nov 05 2026 - 12:08:47 EST
On Thu, Nov 5, 2026 at 4:28 PM Breno Leitao <leitao@xxxxxxxxxx> wrote:
>
> On Thu, Nov 05, 2026 at 04:04:58PM +0100, Christian Brauner wrote:
> > On Thu, Nov 05, 2026 at 08:38:45AM +0800, kernel test robot wrote:
> > > kernel test robot noticed a 18.5% regression of lmbench3.PIPE.bandwidth.MB/sec on:
> > >
> > > commit: f7f4665dc520fd8bbc1db20e59945773e03744a0 ("fs/pipe: unify the page pools into a single per-pipe pool") https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
>
>
> > @Breno can you reproduce this?
> > It's something we should at least investigate.
>
> Ack, I will check it , but not today unfortunately.
>
> I will come back to it tomorrow, and until end of week I will report my
> findings.
I figured it out.
The test at hand has multiple readers and writers using the same pipe,
with 64KB i/os.
Prior to the patch each writer had its own private pool to draw from,
guaranteeing no allocation will happen under the mutex.
With the patch the reader exit also drains the pool.
As a result tons of allocation ends up happening under the lock again:
- 94.88% 94.88% bw_pipe [kernel.kallsyms] [k]
__alloc_frozen_pages_noprof
94.88% __internal_syscall_cancel
entry_SYSCALL_64_after_hwframe
do_syscall_64
ksys_write
vfs_write
- anon_pipe_write
- 47.46% alloc_pages_noprof
alloc_pages_mpol
__alloc_frozen_pages_noprof
- 47.42% anon_pipe_prefill_and_lock
alloc_pages_noprof
alloc_pages_mpol
__alloc_frozen_pages_noprof
I don't think multiple high-volume writers vs multiple high
volume-readers is a realistic scenario and I would not bother fixing
it.
However, should someone want to address it, I think the patch should
be reverted and the resulting state tweaked. The patch at hand came
with some win for throughput in one reader vs one writer scenario,
which I'm pretty sure stems from postponing page deallocation until
after the mutex is released -- the kernel prior to any of this would
still put_page on the reader side under the lock. This bit would have
to get tweaked to recover the loss in that scenario (not to be
confused with the loss reported here).
tl;dr i think this is a EIRRELEVANT kind of a report