提交 f1d1f6c6 编写于 作者: W Wang ShaoBo 提交者: Yang Yingliang

arm64/mpam: resctrl: Allow setting register MPAMCFG_MBW_MIN to 0

hulk inclusion
category: bugfix
bugzilla: 34278
CVE: NA

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

Unlike mbw max(Memory Bandwidth Maximum), sometimes we don't want make use
of mbw min feature(this for restrict memory bandwidth maximum capacity
partition by using MPAMCFG_MBW_MIN, MBMIN row in schemata) and set
MPAMCFG_MBW_MIN to 0.

e.g.
    > mount -t resctrl resctrl /sys/fs/resctrl/ -o mbMin
    > cd resctrl/ && cat schemata
      L3:0=7fff;1=7fff;2=7fff;3=7fff
      MBMIN:0=0;1=0;2=0;3=0

    # before revision
    > echo 'MBMIN:0=0;1=0;2=0;3=0' > schemata
    > cat schemata
      L3:0=7fff;1=7fff;2=7fff;3=7fff
      MBMIN:0=2;1=2;2=2;3=2

    # after revision
    > echo 'MBMIN:0=0;1=0;2=0;3=0' > schemata
    > cat schemata
      L3:0=7fff;1=7fff;2=7fff;3=7fff
      MBMIN:0=0;1=0;2=0;3=0

Fixes: 8139268b ("arm64/mpam: Supplement additional useful ctrl features for mount options")
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: NJian Cheng <cj.chengjian@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 67adc53a
...@@ -333,13 +333,18 @@ parse_bw(char *buf, struct resctrl_resource *r, ...@@ -333,13 +333,18 @@ parse_bw(char *buf, struct resctrl_resource *r,
switch (rr->ctrl_features[type].evt) { switch (rr->ctrl_features[type].evt) {
case QOS_MBA_MAX_EVENT_ID: case QOS_MBA_MAX_EVENT_ID:
case QOS_MBA_MIN_EVENT_ID:
case QOS_MBA_PBM_EVENT_ID: case QOS_MBA_PBM_EVENT_ID:
if (kstrtoul(buf, rr->ctrl_features[type].base, &data)) if (kstrtoul(buf, rr->ctrl_features[type].base, &data))
return -EINVAL; return -EINVAL;
data = (data < r->mbw.min_bw) ? r->mbw.min_bw : data; data = (data < r->mbw.min_bw) ? r->mbw.min_bw : data;
data = roundup(data, r->mbw.bw_gran); data = roundup(data, r->mbw.bw_gran);
break; break;
case QOS_MBA_MIN_EVENT_ID:
if (kstrtoul(buf, rr->ctrl_features[type].base, &data))
return -EINVAL;
/* for mbw min feature, 0 of setting is allowed */
data = roundup(data, r->mbw.bw_gran);
break;
default: default:
if (kstrtoul(buf, rr->ctrl_features[type].base, &data)) if (kstrtoul(buf, rr->ctrl_features[type].base, &data))
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册