Skip to content

Commit d996ec0

Browse files
Peter Zijlstrapundiramit
authored andcommitted
UPSTREAM: sched/core: Add missing update_rq_clock() in detach_task_cfs_rq()
Instead of adding the update_rq_clock() all the way at the bottom of the callstack, add one at the top, this to aid later effort to minimize update_rq_lock() calls. WARNING: CPU: 0 PID: 1 at ../kernel/sched/sched.h:797 detach_task_cfs_rq() rq->clock_update_flags < RQCF_ACT_SKIP Call Trace: dump_stack() __warn() warn_slowpath_fmt() detach_task_cfs_rq() switched_from_fair() __sched_setscheduler() _sched_setscheduler() sched_set_stop_task() cpu_stop_create() __smpboot_create_thread.part.2() smpboot_register_percpu_thread_cpumask() cpu_stop_init() do_one_initcall() ? print_cpu_info() kernel_init_freeable() ? rest_init() kernel_init() ret_from_fork() Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org> (cherry picked from commit 80f5c1b84baa8180c3c27b7e227429712cd967b6) Change-Id: Ibffde077d18eabec4c2984158bd9d6d73bd0fb96 Signed-off-by: Brendan Jackman <brendan.jackman@arm.com> Signed-off-by: Chris Redpath <chris.redpath@arm.com>
1 parent fc63c5c commit d996ec0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

kernel/sched/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3578,6 +3578,7 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
35783578
BUG_ON(prio > MAX_PRIO);
35793579

35803580
rq = __task_rq_lock(p);
3581+
update_rq_clock(rq);
35813582

35823583
/*
35833584
* Idle task boosting is a nono in general. There is one
@@ -4095,6 +4096,7 @@ static int __sched_setscheduler(struct task_struct *p,
40954096
* runqueue lock must be held.
40964097
*/
40974098
rq = task_rq_lock(p, &flags);
4099+
update_rq_clock(rq);
40984100

40994101
/*
41004102
* Changing the policy of the stop threads its a very bad idea
@@ -8685,6 +8687,7 @@ static void cpu_cgroup_fork(struct task_struct *task, void *private)
86858687

86868688
rq = task_rq_lock(task, &flags);
86878689

8690+
update_rq_clock(rq);
86888691
sched_change_group(task, TASK_SET_GROUP);
86898692

86908693
task_rq_unlock(rq, task, &flags);

0 commit comments

Comments
 (0)