Re: [PATCH 07/11] cgroup: fetch cpu-specific lock in rstat cpu lock helpers

Shakeel Butt
2025-02-21T22:35:11Z

On Mon, Feb 17, 2025 at 07:14:44PM -0800, JP Kobryn wrote:
> The lock/unlock helper functions for per-cpu locks accept a cpu
> argument. This makes them appear as if the cpu will be used as the
> offset off of the base per-cpu pointer. But in fact, the cpu is only
> used as a tracepoint argument. Change the functions so that the cpu is
> also used primarily for looking up the lock specific to this cpu. This
> means the call sites can be adjusted to not have to perform the offset
> prior to calling this function. Note that this follows suit with other
> functions in the rstat source - functions that accept a cpu argument
> perform the per-cpu pointer lookup within as opposed to having clients
> lookup in advance.
>
> Signed-off-by: JP Kobryn <inwardvessel@gmail.com>

Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>