Re: [RFC PATCH] cgroup/rstat: convert rstat lock from spinlock to rwlock

From: Falcon, Thomas

Date: Tue May 19 2026 - 14:04:55 EST


On Tue, 2026-05-19 at 07:49 -1000, Tejun Heo wrote:
> On Tue, May 19, 2026 at 12:31:34PM -0500, Thomas Falcon wrote:
> > Implement rstat_ss_lock and rstat_base_lock as read-write locks
> > instead of spinlocks. In addition, update tracing to reflect new
> > locking implementation.
> >
> > The benchmark below, meant to simulate a workload performing many
> > concurrent cgroup cpu.stat reads, completes in 134 seconds on an
> > Intel
> > Xeon Platinum 8568Y with 144 cpus compared to 241 seconds when
> > using spinlocks.
>
> Can you try using seqlock for readers? That'd be decouple readers a
> lot
> better than rwlocks.
>
> Thanks.
>
Hi, thanks for the quick response. I will try that.

Thanks,
Tom