]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sched/core: Remove double update_rq_clock() in __set_cpus_allowed_ptr_locked()
authorHao Jia <jiahao1@lixiang.com>
Wed, 29 Oct 2025 09:36:55 +0000 (17:36 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 11 Nov 2025 11:33:38 +0000 (12:33 +0100)
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>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://patch.msgid.link/20251029093655.31252-1-jiahao.kernel@gmail.com
kernel/sched/core.c

index 67b5f2faab362be9175f82268af2a4bacd72cb2b..68f19aacfdc647767b5bbdeffdc385abbc2f8cb1 100644 (file)
@@ -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,