Re: [PATCH v2 1/2] cgroup: add BPF kfuncs to read a cpu cgroup's stats

From: Tejun Heo

Date: Tue Aug 18 2026 - 18:47:36 EST


On Tue, Aug 18, 2026 at 03:44:36PM -0700, Ziyang Men wrote:
> > > +BTF_KFUNCS_START(bpf_rstat_common_kfunc_ids)
> > > +BTF_ID_FLAGS(func, bpf_css_flush_rstat, KF_SLEEPABLE)
> > > +BTF_ID_FLAGS(func, bpf_cgroup_base_stat, KF_SLEEPABLE)
> >
> > Why are these SLEEPABLE?
> >
>
> The css_rstat_flush() calls might_sleep() and cond_resched().

I see.

> The bpf_cgroup_base_stat() takes an rstat spinlock_t, which can sleep on
> PREEMPT_RT.

Is this actually required? This doesn't really make sense to me. Shouldn't
what SLEEPABLE mean change on RT kernels instead?

Thanks.

--
tejun