From: Peter Zijlstra <peterz@infradead.org>
To: luoliang@kylinos.cn
Cc: Ingo Molnar <mingo@redhat.com>,
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>,
K Prateek Nayak <kprateek.nayak@amd.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/deadline: Use task_on_rq_migrating() helper
Date: Mon, 8 Jun 2026 10:01:56 +0200 [thread overview]
Message-ID: <20260608080156.GA3102624@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20260608065307.280995-1-luoliang@kylinos.cn>
On Mon, Jun 08, 2026 at 02:53:07PM +0800, luoliang@kylinos.cn wrote:
> From: Liang Luo <luoliang@kylinos.cn>
>
> Replace the open-coded "p->on_rq == TASK_ON_RQ_MIGRATING" comparisons
> in enqueue_task_dl() and dequeue_task_dl() with the existing
> task_on_rq_migrating() helper, consistent with the rest of the
> scheduler code.
>
> The helper uses READ_ONCE() when loading ->on_rq, which was added by
> commit c546951d9c93 ("sched/core: Use READ_ONCE()/WRITE_ONCE() in
> move_queued_task()/task_rq_lock()") for LKMM compliance. As documented
> in that commit, move_queued_task() synchronizes with task_rq_lock():
>
> move_queued_task() task_rq_lock()
> [S] ->on_rq = MIGRATING [L] rq = task_rq()
> WMB (__set_task_cpu()) ACQUIRE (rq->lock)
> [S] ->cpu = new_cpu [L] ->on_rq
>
> The READ_ONCE() on the ->on_rq load ensures proper pairing with the
> WRITE_ONCE() on the writer side. The open-coded checks in deadline.c
> lack this annotation.
>
> No functional change.
This is completely irrelevant here. p->on_rq is set with rq->lock held,
and tasks are {en,de}queued with rq->lock held. There is no concurrency.
next prev parent reply other threads:[~2026-06-08 8:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 6:53 luoliang
2026-06-08 7:10 ` K Prateek Nayak
2026-06-08 7:55 ` [PATCH v2] " luoliang
2026-06-09 8:32 ` [tip: sched/core] " tip-bot2 for Liang Luo
2026-06-08 8:01 ` Peter Zijlstra [this message]
2026-06-09 5:52 ` [PATCH] " luoliang
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=20260608080156.GA3102624@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luoliang@kylinos.cn \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--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
Powered by JetHome