Skip to content

Commit e40cea3

Browse files
Hao JiaPeter Zijlstra
authored andcommitted
sched/core: Remove double update_rq_clock() in __set_cpus_allowed_ptr_locked()
Since commit d4c6420 ("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: d4c6420 ("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
1 parent 79f3f9b commit e40cea3

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

kernel/sched/core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2999,8 +2999,6 @@ static int __set_cpus_allowed_ptr_locked(struct task_struct *p,
29992999
unsigned int dest_cpu;
30003000
int ret = 0;
30013001

3002-
update_rq_clock(rq);
3003-
30043002
if (kthread || is_migration_disabled(p)) {
30053003
/*
30063004
* Kernel threads are allowed on online && !active CPUs,

0 commit comments

Comments
 (0)