Commit fca01562 authored by Zhang Qiao's avatar Zhang Qiao Committed by Yang Yingliang
Browse files

sched: unthrottle qos cfs rq when free a task group

hulk inclusion
category: bugfix
bugzilla: 51828, https://gitee.com/openeuler/kernel/issues/I4K96G


CVE: NA

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

Signed-off-by: default avatarZhang Qiao <zhangqiao22@huawei.com>
Signed-off-by: default avatarZheng Zucheng <zhengzucheng@huawei.com>
Reviewed-by: default avatarChen Hui <judy.chenhui@huawei.com>
Reviewed-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent af0d81ab
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -10544,6 +10544,19 @@ static void task_change_group_fair(struct task_struct *p, int type)
	}
}

#ifdef CONFIG_QOS_SCHED
static inline void unthrottle_qos_sched_group(struct cfs_rq *cfs_rq)
{
	struct rq *rq = rq_of(cfs_rq);
	struct rq_flags rf;

	rq_lock_irqsave(rq, &rf);
	if (cfs_rq->tg->qos_level == -1 && cfs_rq_throttled(cfs_rq))
		unthrottle_qos_cfs_rq(cfs_rq);
	rq_unlock_irqrestore(rq, &rf);
}
#endif

void free_fair_sched_group(struct task_group *tg)
{
	int i;
@@ -10551,6 +10564,10 @@ void free_fair_sched_group(struct task_group *tg)
	destroy_cfs_bandwidth(tg_cfs_bandwidth(tg));

	for_each_possible_cpu(i) {
#ifdef CONFIG_QOS_SCHED
		if (tg->cfs_rq)
			unthrottle_qos_sched_group(tg->cfs_rq[i]);
#endif
		if (tg->cfs_rq)
			kfree(tg->cfs_rq[i]);
		if (tg->se)