Unverified Commit d60eaf48 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4561 sched: migtate user interface from smart grid to sched bpf

Merge Pull Request from: @ci-robot 
 
PR sync from: Liao Chen <liaochen4@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/TSIVXWERGQ2EBKV7HOKIYXJVQOYMQ2QC/ 
Migtating user interface from smart grid to sched bpf, which allows
users to set SCHED_GRID_QOS_TASK_LEVEL through:

	/proc/${pid}/task/${pid}/tag

interface. Although arbitrary integer value could be assigned to
<tag>, currnetly we clamp the value of SCHED_GRID_QOS_TASK_LEVEL
to 0-7, which maintains consistency.

Liao Chen (1):
  sched: migtate user interface from smart grid to sched bpf


-- 
2.34.1
 
https://gitee.com/openeuler/kernel/issues/I918W0 
 
Link:https://gitee.com/openeuler/kernel/pulls/4561

 

Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Reviewed-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents d84a2a68 cbc2a5fe
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -3784,6 +3784,20 @@ static ssize_t pid_tag_write(struct file *file, const char __user *buf,

	sched_settag(tsk, tag);

#ifdef CONFIG_QOS_SCHED_SMART_GRID
	if (smart_grid_enabled()) {
		tag = tag < SCHED_GRID_QOS_TASK_LEVEL_HIGHEST ?
			SCHED_GRID_QOS_TASK_LEVEL_HIGHEST : tag;
		tag = tag >= SCHED_GRID_QOS_TASK_LEVEL_MAX ?
			SCHED_GRID_QOS_TASK_LEVEL_DEFAULT : tag;

		if (tsk->grid_qos != NULL &&
		    tsk->grid_qos->stat.set_class_lvl != NULL)
			err = tsk->grid_qos->stat.set_class_lvl(&tsk->grid_qos->stat,
								(unsigned int)tag);
	}
#endif

out:
	put_task_struct(tsk);
	return err < 0 ? err : count;