Re: [linus:master] [x86] 4817f70c25: stress-ng.mmapaddr.ops_per_sec 63.0% regression
From: Rik van Riel
Date: Tue Jan 28 2025 - 13:36:59 EST
On Wed, 2025-01-29 at 01:06 +0800, Qi Zheng wrote:
>
> I did reproduce the performance regression using the following test
> program:
>
> stress-ng --timeout 60 --times --verify --metrics --no-rand-seed
> --mmapaddr 64
>
> And its call stack is as follows:
>
> bpftrace -e 'k:_raw_spin_unlock_irqrestore {@[kstack,comm]=count();}
> interval:s:1 {exit();}'
>
> @[
> _raw_spin_unlock_irqrestore+5
> free_one_page+85
> rcu_do_batch+424
> rcu_core+401
> handle_softirqs+204
> irq_exit_rcu+208
That looks like the RCU freeing somehow bypassing the
per-cpu-pages, and hitting the zone->lock at page free
time, while regular freeing usually puts pages in the
CPU-local free page cache, without the lock?
I'm not quite sure why this would be happening, though.
Maybe the RCU batches are too big for the PCPs to
hold them?
If that is the case, chances are more code paths are
hitting that issue, and we should just fix it, rather
than trying to bypass it.
Maybe the reason is more simple than that?
I have not found a place where it explicitly bypasses
the PCPs, but who knows?
--
All Rights Reversed.