未验证 提交 886a7963 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!259 cgroup: Support iocost for cgroup v1

Merge Pull Request from: @linan888 
 
Since iocost can only be used in cgroup v2, add it to v1 now. 
 
Link:https://gitee.com/openeuler/kernel/pulls/259 
Reviewed-by: Hou Tao <houtao1@huawei.com> 
Reviewed-by: Zheng Zengkai <zhengzengkai@huawei.com> 
Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> 
...@@ -3397,6 +3397,28 @@ static ssize_t ioc_cost_model_write(struct kernfs_open_file *of, char *input, ...@@ -3397,6 +3397,28 @@ static ssize_t ioc_cost_model_write(struct kernfs_open_file *of, char *input,
return ret; return ret;
} }
static struct cftype ioc_legacy_files[] = {
{
.name = "cost.weight",
.flags = CFTYPE_NOT_ON_ROOT,
.seq_show = ioc_weight_show,
.write = ioc_weight_write,
},
{
.name = "cost.qos",
.flags = CFTYPE_ONLY_ON_ROOT,
.seq_show = ioc_qos_show,
.write = ioc_qos_write,
},
{
.name = "cost.model",
.flags = CFTYPE_ONLY_ON_ROOT,
.seq_show = ioc_cost_model_show,
.write = ioc_cost_model_write,
},
{}
};
static struct cftype ioc_files[] = { static struct cftype ioc_files[] = {
{ {
.name = "weight", .name = "weight",
...@@ -3421,6 +3443,7 @@ static struct cftype ioc_files[] = { ...@@ -3421,6 +3443,7 @@ static struct cftype ioc_files[] = {
static struct blkcg_policy blkcg_policy_iocost = { static struct blkcg_policy blkcg_policy_iocost = {
.dfl_cftypes = ioc_files, .dfl_cftypes = ioc_files,
.legacy_cftypes = ioc_legacy_files,
.cpd_alloc_fn = ioc_cpd_alloc, .cpd_alloc_fn = ioc_cpd_alloc,
.cpd_free_fn = ioc_cpd_free, .cpd_free_fn = ioc_cpd_free,
.pd_alloc_fn = ioc_pd_alloc, .pd_alloc_fn = ioc_pd_alloc,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册