Skip to content

Commit 1bc9743

Browse files
committed
Merge tag 'sched_urgent_for_v6.18_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fix from Borislav Petkov: - Make sure a CFS runqueue on a throttled hierarchy has its PELT clock throttled otherwise task movement and manipulation would lead to dangling cfs_rq references and an eventual crash * tag 'sched_urgent_for_v6.18_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Start a cfs_rq on throttled hierarchy with PELT clock throttled
2 parents 7ea5092 + 0e4a169 commit 1bc9743

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

kernel/sched/fair.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6437,6 +6437,16 @@ static void sync_throttle(struct task_group *tg, int cpu)
64376437

64386438
cfs_rq->throttle_count = pcfs_rq->throttle_count;
64396439
cfs_rq->throttled_clock_pelt = rq_clock_pelt(cpu_rq(cpu));
6440+
6441+
/*
6442+
* It is not enough to sync the "pelt_clock_throttled" indicator
6443+
* with the parent cfs_rq when the hierarchy is not queued.
6444+
* Always join a throttled hierarchy with PELT clock throttled
6445+
* and leaf it to the first enqueue, or distribution to
6446+
* unthrottle the PELT clock.
6447+
*/
6448+
if (cfs_rq->throttle_count)
6449+
cfs_rq->pelt_clock_throttled = 1;
64406450
}
64416451

64426452
/* conditionally throttle active cfs_rq's from put_prev_entity() */
@@ -13187,6 +13197,8 @@ static void propagate_entity_cfs_rq(struct sched_entity *se)
1318713197
if (!cfs_rq_pelt_clock_throttled(cfs_rq))
1318813198
list_add_leaf_cfs_rq(cfs_rq);
1318913199
}
13200+
13201+
assert_list_leaf_cfs_rq(rq_of(cfs_rq));
1319013202
}
1319113203
#else /* !CONFIG_FAIR_GROUP_SCHED: */
1319213204
static void propagate_entity_cfs_rq(struct sched_entity *se) { }

0 commit comments

Comments
 (0)