Re: [PATCH] cgroup/rstat: avoid disabling irqs for O(num_cpu)
From: Michal Koutný
Date: Tue Apr 01 2025 - 12:59:45 EST
On Tue, Apr 01, 2025 at 05:46:41PM +0200, Mateusz Guzik <mjguzik@xxxxxxxxx> wrote:
> Is this really going to suffer for toggling every 8 CPUs? that's a 50x
> factor reduction
As per the original patch, there's ~10x saving in max holding irqs-off,
naïevely thinking aggregating it flushing by 8 CPUs could reduce it to
(10/8) ~1.25x saving only.
(OTOH, it's not 400x effect, so it's not explained completely, not all
CPUs are same.) I can imagine the balanced value with this information
would be around 20 CPUs (sqrt(400)).
But the issue is it could as well be 4 or 32 or 8. Starting with 1 is
the simplest approach without introducing magic constants or heuristics.
> the temp changes like the to stay for a long time.
That'd mean that no one notices the performance impact there :-)
It can be easily changed later too.
> that said, there is bigger fish to fry elsewhere and I have no stake
> in this code, so I'm not going to mail any further about this.
Thank you for spending your effort on this, it's useful reference for
the future!
Michal
Attachment:
signature.asc
Description: PGP signature