[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <v572yf2qnle6ikxjb2ofvcmkuvpantmngrprrofd4kcia4xtld@uge7ti65njyj>
Date: Thu, 31 Jul 2025 17:26:28 +0200
From: Michal Koutný <mkoutny@...e.com>
To: Bertrand Wlodarczyk <bertrand.wlodarczyk@...el.com>
Cc: tj@...nel.org, hannes@...xchg.org, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, shakeel.butt@...ux.dev, inwardvessel@...il.com
Subject: Re: [PATCH] cgroup/rstat: move css_rstat_lock outside cpu loop
On Tue, Jul 22, 2025 at 02:43:19PM +0200, Bertrand Wlodarczyk <bertrand.wlodarczyk@...el.com> wrote:
> By moving the lock outside the CPU loop, we reduce the frequency
> of costly lock acquisition.
So IIUC, mere acquisition is so costly that it dwarves actual holding
(flushing) as there are presumbly no updates collected.
As Shakeel wrote, there are reasons for not holding this lock for very
long (beside that being a general rule).
> This adjustment slightly improves performance in scenarios where
> multiple CPUs concurrently attempt to acquire the lock for
> the same css.
It means they can read cpu.stat more frequently but will they get any
fresher or more precise data? This is not clear to me, I understand why
this benchmark improves but does it represent some real world
improvement?
Thanks,
Michal
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists