• W
    arm64/mpam: Supplement additional useful ctrl features for mount options · 8139268b
    Wang ShaoBo 提交于
    hulk inclusion
    category: feature
    bugzilla: 34278
    CVE: NA
    
    -------------------------------------------------
    
    Based on 61fa56e1dd8a ("arm64/mpam: Add resctrl_ctrl_feature structure to manage
    ctrl features"), we add several ctrl features and supply corresponding
    mount options, including mbPbm, mbMax, mbMin, mbPrio, caMax, caPrio, caPbm,
    if MPAM system supports relevant features, we can mount resctrl like this:
    
    e.g.
       > mount -t resctrl resctrl /sys/fs/resctrl -o mbMax,mbMin,caPrio
       > cd /sys/fs/resctrl && cat schemata
         L3:0=0x7fff;1=0x7fff;2=0x7fff;3=0x7fff #default select cpbm as basic ctrl feature
         L3PRI:0=3;1=3;2=3;3=3
         MBMAX:0=100;1=100;2=100;3=100
         MBMIN:0=0;1=0;2=0;3=0
    
       > mount -t resctrl resctrl /sys/fs/resctrl
       > cd /sys/fs/resctrl && cat schemata
         L3:0=0x7fff;1=0x7fff;2=0x7fff;3=0x7fff #default select cpbm as basic ctrl feature
         MB:0=100;1=100;2=100;3=100  #default select mbw max as basic ctrl feature
    
       > mount -t resctrl resctrl /sys/fs/resctrl -o caMax
       > cd /sys/fs/resctrl && cat schemata
         L3:0=33554432;1=33554432;2=33554432;3=33554432 #use cmax ctrl feature
         MB:0=100;1=100;2=100;3=100  #default select mbw max as basic ctrl feature
    
    For Cache MSCs, basic ctrl features include cmax(Cache Maximum Capacity)
    and cpbm(Cache protion bitmap) partition, if mount options are not specified,
    default cpbm will be selected.
    
    For Memory MSCs, basic ctrl features include max(Memory Bandwidth Maximum)
    and pbm(Memory Bandwidth Portion Bitmap) partition, if mount options are
    not specified, default max will be selected.
    
    Above mount options also can be used accompany with cdp options.
    
    e.g.
       > mount -t resctrl resctrl /sys/fs/resctrl -o caMax,caPrio,cdpl3
       > cd /sys/fs/resctrl && cat schemata
         L3CODE:0=33554432;1=33554432;2=33554432;3=33554432 #code use cmax ctrl feature
         L3DATA:0=33554432;1=33554432;2=33554432;3=33554432 #data use cmax ctrl feature
         L3CODEPRI:0=3;1=3;2=3;3=3 #code use intpriority ctrl feature
         L3DATAPRI:0=3;1=3;2=3;3=3 #data use intpriority ctrl feature
         MB:0=100;1=100;2=100;3=100  #default select mbw max as basic ctrl feature
    
    By combining these mount parameters can we use MPAM more powerfully.
    Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
    Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
    Reviewed-by: NCheng Jian <cj.chengjian@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
    8139268b
resctrl.h 12.8 KB