Commit 17edb7ed authored by Wenyu Huang's avatar Wenyu Huang Committed by liukai
Browse files

Fix SCHED_WARN_ON(cfs_rq->throttled_clock) in throttle_cfs_rq

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB7FU1



--------------------------------

In enqueue_entity, it assigns rq_clock(rq) to a cfs_rq when this cfs_rq is
throttled by QOS, which causes SCHED_WARN_ON(cfs_rq->throttled_clock) in
throttle_cfs_rq.
So we add a "cfs_rq->throttled != QOS_THROTTLED" check to avoid assign
rq_clock to the cfs_rq throttled by QOS.

Fixes: 926b9b0c ("sched: Throttle qos cfs_rq when current cpu is running online task")
Signed-off-by: default avatarWenyu Huang <huangwenyu5@huawei.com>
Signed-off-by: default avatarLiu Kai <liukai284@huawei.com>
parent 95bc6947
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -5466,6 +5466,9 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
		if (!throttled_hierarchy(cfs_rq)) {
			list_add_leaf_cfs_rq(cfs_rq);
		} else {
#ifdef CONFIG_QOS_SCHED
			if (cfs_rq->throttled != QOS_THROTTLED) {
#endif
#ifdef CONFIG_CFS_BANDWIDTH
				struct rq *rq = rq_of(cfs_rq);

@@ -5473,6 +5476,9 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
					cfs_rq->throttled_clock = rq_clock(rq);
				if (!cfs_rq->throttled_clock_self)
					cfs_rq->throttled_clock_self = rq_clock(rq);
#endif
#ifdef CONFIG_QOS_SCHED
			}
#endif
		}
	}