• W
    arm64/mpam: Using software-defined id for rdtgroup instead of 32-bit integer · 26a57873
    Wang ShaoBo 提交于
    hulk inclusion
    category: feature
    feature: ARM MPAM support
    bugzilla: 48265
    CVE: NA
    
    --------------------------------
    
    Currently we use partid and pmg (Performance Monitoring Group) to filter
    some performance events so that the performance of a particular partid
    and pmg can be monitored, but pmg looks useless except for making a
    filter with partid, especially when pmg varies in different MPAM resources,
    it makes difficult to allocate pmg resource when creating new mon group
    in resctrl sysfs, even causes a lot of waste.
    
    So we use a software-defined sd_closid instead of 32-bit integer to label
    each rdtgroup (including mon group), sd_closid include intpartid for
    allocation and reqpartid for synchronizing configuration and monitoring,
    Given MPAM has narrowing feature, also includes the concept (hw_reqpartid,
    hw_intpartid we named), when narrowing is not supported, number of intpartid
    and reqpartid equals to hw_reqpartid, otherwise intpartid and reqpartid is
    related to minimum number of both hw_reqpartid and hw_intpartid supported
    across different resources, by using this way, not only we solve above
    problem but also use relax reqpartid for creating new mon group. additionally,
    pmg is also preferred when it is available.
    
    e.g.
         hw_intpartid:  0  1  2  3  4  5  6  7
         hw_reqpartid:  0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15
    
                        |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
                                                |  |  |  |  |  |  |  |
    resctrl ctrl group: p0 p1 p2 p3 p4 p5 p6 p7 |  |  |  |  |  |  |  |
                              |     |
    resctrl mon group:        |     +-----------------------m4 m5 m6 m7
                              +-----------------m0 m1 m2 m3
                              In this case, use extra reqpartid to create
                              m0, m1, m2, m3 mon group for p2 ctrl group,
                              and m4, m5, m6, m7 for p4.
    
    As we know reqpartid both supports allocating and monitoring filter, we
    should synchronize config of ctrl group with child mon groups under this
    design, each mon group's configuration indexed by a reqpartid that called
    slave is closely following it's father ctrl group that called master
    whenever configuration changes. not only that, we let task_struct keep
    both intpartid and reqpartid so we can know if tasks belong to a same
    ctrl group through intpartid and change cpu's partid by writing MPAMx_ELx
    through reqpartid when tasks switching.
    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: NZheng Zengkai <zhengzengkai@huawei.com>
    26a57873
mpam_resource.h 7.8 KB