提交 96a27f9d 编写于 作者: W Wang ShaoBo 提交者: Zheng Zengkai

arm64/mpam: resctrl: Use resctrl_group_init_alloc() for default group

hulk inclusion
category: bugfix
bugzilla: 48265
CVE: NA

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

When we support configure different types of resources for a resource, the
wrong history value will be updated in the default group after remounting.

e.g.
    > mount -t resctrl resctrl /sys/fs/resctrl/ -o mbMax,mbMin && cd resctrl/
    > echo 'MBMIN:0=2;1=2;2=2;3=2' > schemata
    > cat schemata
      L3:0=7fff;1=7fff;2=7fff;3=7fff
      MBMAX:0=100;1=100;2=100;3=100
      MBMIN:0=2;1=2;2=2;3=2
    > cd .. && umount /sys/fs/resctrl/
    > mount -t resctrl resctrl /sys/fs/resctrl/ -o mbMax,mbMin && cd resctrl/ && cat schemata
      L3:0=7fff;1=7fff;2=7fff;3=7fff
      MBMAX:0=100;1=100;2=100;3=100
      MBMIN:0=0;1=0;2=0;3=0
    > echo 'MBMAX:0=10;1=10;2=10;3=10' > schemata
    > cat schemata
      L3:0=7fff;1=7fff;2=7fff;3=7fff
      MBMAX:0=10;1=10;2=10;3=10
      MBMIN:0=2;1=2;2=2;3=2  #update error history value

When writing schemata sysfile, call path like this:

resctrl_group_schemata_write()
  -=> resctrl_update_groups_config()
         -=> resctrl_group_update_domains()
               -=> resctrl_group_update_domain_ctrls()
                { .../*refresh new_ctrl array of supported conf type once for each resource*/ }

We should refresh new_ctrl field in struct resctrl_staged_config by
resctrl_group_init_alloc() before calling resctrl_group_update_domain_ctrls().

Fixes: 6b2471f089be ("arm64/mpam: resctrl: Support priority and hardlimit(Memory bandwidth) configuration")
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: NCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 10e4e43b
......@@ -406,6 +406,10 @@ static int resctrl_get_tree(struct fs_context *fc)
if (ret)
goto out_schema;
ret = resctrl_group_init_alloc(&resctrl_group_default);
if (ret < 0)
goto out_schema;
ret = resctrl_group_create_info_dir(resctrl_group_default.kn, &kn_info);
if (ret)
goto out_schema;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册