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

Tejun Heo <[email protected]>
Newsgroups org.kernel.vger.cgroups,org.kernel.vger.bpf,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.