Skip to content

Commit 7bdf8c0

Browse files
auldpgregkh
authored andcommitted
sched/fair: Use rq_lock/unlock in online_fair_sched_group
[ Upstream commit a46d14e ] Enabling WARN_DOUBLE_CLOCK in /sys/kernel/debug/sched_features causes warning to fire in update_rq_clock. This seems to be caused by onlining a new fair sched group not using the rq lock wrappers. [] rq->clock_update_flags & RQCF_UPDATED [] WARNING: CPU: 5 PID: 54385 at kernel/sched/core.c:210 update_rq_clock+0xec/0x150 [] Call Trace: [] online_fair_sched_group+0x53/0x100 [] cpu_cgroup_css_online+0x16/0x20 [] online_css+0x1c/0x60 [] cgroup_apply_control_enable+0x231/0x3b0 [] cgroup_mkdir+0x41b/0x530 [] kernfs_iop_mkdir+0x61/0xa0 [] vfs_mkdir+0x108/0x1a0 [] do_mkdirat+0x77/0xe0 [] do_syscall_64+0x55/0x1d0 [] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Using the wrappers in online_fair_sched_group instead of the raw locking removes this warning. [ tglx: Use rq_*lock_irq() ] Signed-off-by: Phil Auld <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Vincent Guittot <[email protected]> Cc: Ingo Molnar <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 5de4dee commit 7bdf8c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/sched/fair.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10301,18 +10301,18 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
1030110301
void online_fair_sched_group(struct task_group *tg)
1030210302
{
1030310303
struct sched_entity *se;
10304+
struct rq_flags rf;
1030410305
struct rq *rq;
1030510306
int i;
1030610307

1030710308
for_each_possible_cpu(i) {
1030810309
rq = cpu_rq(i);
1030910310
se = tg->se[i];
10310-
10311-
raw_spin_lock_irq(&rq->lock);
10311+
rq_lock_irq(rq, &rf);
1031210312
update_rq_clock(rq);
1031310313
attach_entity_cfs_rq(se);
1031410314
sync_throttle(tg, i);
10315-
raw_spin_unlock_irq(&rq->lock);
10315+
rq_unlock_irq(rq, &rf);
1031610316
}
1031710317
}
1031810318

0 commit comments

Comments
 (0)