Commit 58165b16 authored by zhangwei123171's avatar zhangwei123171
Browse files

sched/fair: ignore the rt or dl task in tg_change_scheduler

jingdong inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7S71H



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

When switching the sched policy of the container process
through qos_level, you need to ignore the rt or dl task.

Both online task and offline task are limited to the
cfs scheduling class.

Fixes: bda15404 ("sched: Introduce qos scheduler for co-location")
Signed-off-by: default avatarzhangwei123171 <zhangwei123171@jd.com>
Reviewed-by: default avatarzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
parent 3feff602
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -9481,8 +9481,14 @@ static int tg_change_scheduler(struct task_group *tg, void *data)

	param.sched_priority = 0;
	css_task_iter_start(css, 0, &it);
	while ((tsk = css_task_iter_next(&it)))
	while ((tsk = css_task_iter_next(&it))) {
		if (unlikely(rt_task(tsk) || dl_task(tsk))) {
			pr_warn("skip %s/%d when setting qos_level\n", tsk->comm, tsk->pid);
			continue;
		}

		sched_setscheduler(tsk, policy, &param);
	}
	css_task_iter_end(&it);

	return 0;