From: Tejun Heo <tj@kernel.org>
To: Ziyang Men <ziyang.meme@gmail.com>
Cc: "Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
"Shuah Khan" <shuah@kernel.org>,
kernel-team@meta.com, "Ingo Molnar" <mingo@redhat.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Vincent Guittot" <vincent.guittot@linaro.org>,
"Ben Segall" <bsegall@google.com>,
"Dietmar Eggemann" <dietmar.eggemann@arm.com>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Jiri Olsa" <jolsa@kernel.org>,
"Emil Tsalapatis" <emil@etsalapatis.com>,
"Roman Gushchin" <roman.gushchin@linux.dev>,
"Shakeel Butt" <shakeel.butt@linux.dev>,
"JP Kobryn" <inwardvessel@gmail.com>,
bpf@vger.kernel.org, cgroups@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] cgroup: add BPF kfuncs to read a cpu cgroup's stats
Date: Wed, 19 Aug 2026 10:55:59 -1000 [thread overview]
Message-ID: <aoYYX60TCD6cd601@slm.duckdns.org> (raw)
In-Reply-To: <aoTx1eaNNJ+xrUq1@devvm16600.scu0.facebook.com>
Hello,
On Tue, Aug 18, 2026 at 04:59:17PM -0700, Ziyang Men wrote:
> > > 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?
>
> Oh sorry, I didn't notice that.
>
> I might be wrong: this function calls the cputime_adjust(), which in turn
> acquires raw_spin_lock_irqsave(), so there would be NMI deadlock in the
> perf_event program. The __css_rstat_lock() take the spin_lock_irq() as well. So
> maybe a SLEEPABLE tag is still necessary?
I think this is for BPF folks to answer. I don't think SLEEPABLE is needed
because of RT but yeah it wouldn't be safe to be called from nmi context.
Thanks.
--
tejun
next prev parent reply other threads:[~2026-08-19 20:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 0:24 [PATCH v2 0/2] cgroup: expose cpu.stat to BPF Ziyang Men
2026-08-18 0:24 ` [PATCH v2 1/2] cgroup: add BPF kfuncs to read a cpu cgroup's stats Ziyang Men
2026-08-18 1:28 ` bot+bpf-ci
2026-08-18 17:16 ` Tejun Heo
2026-08-18 22:44 ` Ziyang Men
2026-08-18 22:47 ` Tejun Heo
2026-08-18 23:59 ` Ziyang Men
2026-08-19 20:55 ` Tejun Heo [this message]
2026-08-18 0:24 ` [PATCH v2 2/2] selftests/bpf: add cgroup_iter_cpu test for cpu cgroup kfuncs Ziyang Men
2026-08-18 1:28 ` bot+bpf-ci
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aoYYX60TCD6cd601@slm.duckdns.org \
--to=tj@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=bsegall@google.com \
--cc=cgroups@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dietmar.eggemann@arm.com \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=hannes@cmpxchg.org \
--cc=inwardvessel@gmail.com \
--cc=jolsa@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=mingo@redhat.com \
--cc=mkoutny@suse.com \
--cc=peterz@infradead.org \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=yonghong.song@linux.dev \
--cc=ziyang.meme@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.