[PATCH OLK-6.6 V1] cgroup/cpuset: Support dynamic affinity feature

From: Hui Tang <tanghui20@huawei.com> hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/ICUCZD -------------------------------- Add cgroup v2 interface for dynamic affinty. Cgroup v2 use dynamic affinty, as follows: mkdir /sys/fs/cgroup/my_tg/ echo 0-7 > /sys/fs/cgroup/my_tg/cpuset.cpus echo 0-3 > /sys/fs/cgroup/my_tg/cpuset.preferred_cpus echo {pid} > /sys/fs/cgroup/my_tg/cgroup.procs Signed-off-by: Hui Tang <tanghui20@huawei.com> Signed-off-by: Cheng Yu <serein.chengyu@huawei.com> --- kernel/cgroup/cpuset.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index f53b28f3542c..9e1a4680860e 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -4074,6 +4074,17 @@ static struct cftype dfl_files[] = { .flags = CFTYPE_ONLY_ON_ROOT | CFTYPE_DEBUG, }, +#ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY + { + .name = "preferred_cpus", + .seq_show = cpuset_common_seq_show, + .write = cpuset_write_resmask, + .max_write_len = (100U + 6 * NR_CPUS), + .private = FILE_DYNAMIC_CPULIST, + .flags = CFTYPE_NOT_ON_ROOT, + }, +#endif + { } /* terminate */ }; -- 2.25.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/17660 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/ETK... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/17660 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/ETK...
participants (2)
-
Cheng Yu
-
patchwork bot