From: Hao Jia <jiahao.kernel@gmail.com>
To: mingo@redhat.com, peterz@infradead.org, mingo@kernel.org,
juri.lelli@redhat.com, vincent.guittot@linaro.org,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
kprateek.nayak@amd.com
Cc: linux-kernel@vger.kernel.org, Hao Jia <jiahao1@lixiang.com>
Subject: [PATCH] sched/core: Remove double update_rq_clock() in __set_cpus_allowed_ptr_locked()
Date: Wed, 29 Oct 2025 17:36:55 +0800 [thread overview]
Message-ID: <20251029093655.31252-1-jiahao.kernel@gmail.com> (raw)
From: Hao Jia <jiahao1@lixiang.com>
Since commit d4c64207b88a ("sched: Cleanup the sched_change NOCLOCK usage"),
update_rq_clock() is called in do_set_cpus_allowed() -> sched_change_begin()
to update the rq clock. This results in a duplicate call update_rq_clock()
in __set_cpus_allowed_ptr_locked().
While holding the rq lock and before calling do_set_cpus_allowed(),
there is nothing that depends on an updated rq_clock.
Therefore, remove the redundant update_rq_clock() in
__set_cpus_allowed_ptr_locked() to avoid the warning about double
rq clock updates.
Fixes: d4c64207b88a ("sched: Cleanup the sched_change NOCLOCK usage")
Signed-off-by: Hao Jia <jiahao1@lixiang.com>
---
kernel/sched/core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 1842285eac1e..1123cd0ddffb 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2999,8 +2999,6 @@ static int __set_cpus_allowed_ptr_locked(struct task_struct *p,
unsigned int dest_cpu;
int ret = 0;
- update_rq_clock(rq);
-
if (kthread || is_migration_disabled(p)) {
/*
* Kernel threads are allowed on online && !active CPUs,
--
2.34.1
next reply other threads:[~2025-10-29 9:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 9:36 Hao Jia [this message]
2025-10-30 4:04 ` [PATCH] sched/core: Remove double update_rq_clock() in __set_cpus_allowed_ptr_locked() K Prateek Nayak
2025-10-30 9:14 ` Peter Zijlstra
2025-11-11 11:37 ` [tip: sched/core] " tip-bot2 for Hao Jia
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=20251029093655.31252-1-jiahao.kernel@gmail.com \
--to=jiahao.kernel@gmail.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=jiahao1@lixiang.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--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