mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: cgroups@vger.kernel.org, hannes@cmpxchg.org, mkoutny@suse.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] cgroup: drop preemption_disabled checking
Date: Wed, 19 Nov 2025 05:59:37 -1000	[thread overview]
Message-ID: <aR3paXRgyxdeO4sC@slm.duckdns.org> (raw)
In-Reply-To: <20251119111402.153727-1-jiayuan.chen@linux.dev>

Hello,

On Wed, Nov 19, 2025 at 07:14:01PM +0800, Jiayuan Chen wrote:
> BPF programs do not disable preemption, they only disable migration.
> Therefore, when running the cgroup_hierarchical_stats selftest, a
> warning [1] is generated.
> 
> The css_rstat_updated() function is lockless and reentrant, so checking
> for disabled preemption is unnecessary (please correct me if I'm wrong).

While it won't crash the kernel to schedule while running the function,
there are timing considerations here. If the thread which wins the lnode
competition gets scheduled out, there can be significant unexpected delays
for others that lost against it. Maybe just update the caller to disable
preemption?

Thanks.

-- 
tejun

  reply	other threads:[~2025-11-19 15:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 11:14 Jiayuan Chen
2025-11-19 15:59 ` Tejun Heo [this message]
2025-11-20  1:57   ` Jiayuan Chen

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=aR3paXRgyxdeO4sC@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=jiayuan.chen@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkoutny@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®