From: Hui Su <sh_def@163.com>
To: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
Mike Galbraith <efault@gmx.de>,
linux-kernel@vger.kernel.org, Hui Su <sh_def@163.com>
Subject: Re: [PATCH] sched/autogroup: Serialize nice rate-limit updates
Date: Mon, 12 Oct 2026 16:44:12 +0900 [thread overview]
Message-ID: <0b01765544ac7b56e065f4b0e3e4a91b@163.com> (raw)
In-Reply-To: <19b982f8-f4a0-4d47-8f56-0779e691f0eb@amd.com>
> Is it really that big of a problem?
I agree that the impact is limited. The issue is that concurrent
unprivileged callers can pass the same expired rate-limit window and
weaken the intended throttling of the expensive task-group update path.
> That comment suggests we don't want to take any global locks but this
> adds one more? Is that a good idea?
>
> Spinlock looks too heavy-handed for this. You can perhaps do a simple
> try_cmpxchg() and the ones that fails it can simply return -EAGAIN.
>
> Thoughts?
I agree that try_cmpxchg() is a better fit than adding another global
lock. One unprivileged caller can claim an expired rate-limit window,
while unprivileged callers that lose the cmpxchg can return -EAGAIN
without serializing on a spinlock or entering the expensive update path.
The v2 implementation needs to preserve the existing CAP_SYS_ADMIN behavior:
privileged callers bypass the rate-limit check but still update next. Thus,
an admin caller that loses the cmpxchg must retry rather than return
-EAGAIN.
I'll rework this along those lines for v2. I'll rerun the KCSAN and
rate-limit tests and add coverage for concurrent CAP_SYS_ADMIN callers
to verify that cmpxchg contention does not introduce an -EAGAIN result
for privileged callers.
Thanks for the review.
Thanks and Regards,
Hui
prev parent reply other threads:[~2026-10-12 8:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 6:44 Hui Su
2026-10-08 12:28 ` Mike Galbraith
2026-10-12 3:14 ` K Prateek Nayak
2026-10-12 7:44 ` Hui Su [this message]
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=0b01765544ac7b56e065f4b0e3e4a91b@163.com \
--to=sh_def@163.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=efault@gmx.de \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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®