• W
    arm64/mpam: Add wait queue for monitor alloc and free · 7d3cd1a2
    Wang ShaoBo 提交于
    hulk inclusion
    category: feature
    feature: ARM MPAM support
    bugzilla: 48265
    CVE: NA
    
    --------------------------------
    
    For MPAM, a rmid can do monitoring work only with a monitor resource
    allocated, we adopt a mechanism for monitor resource dynamic allocation
    and recycling, it is different from Intel-RDT operation who creates a
    kworker thread for dynamically monitoring Cache usage and checks if it
    is below a threshold adjustable for rmid free, for we have detected that
    this method will affect the cpu utilization in many cases, sometimes this
    influence cannot be accepted.
    
    Our method is simple, as different resource's monitor number varies, we
    deliever two list, one for storing rmids which has exclusive monitor
    resource and another for storing this rmids which have monitor resource
    shared, this shared monitor id always be 0. it works like this, if a new
    rmid apply for a resource monitor which is in used, then we put this rmid
    to the tail of latter list and temporarily give a default monitor id 0
    util someone releases available monitor resource, if this new rmid has
    all resources' monitor resource needed, then it will be put into exclusive
    list.
    
    This implements the LRU allocation of monitor resources and give users
    part control rights of allocation and release, if resctrl group's quantity
    can be guaranteed or user don't need monitoring too many groups
    synchronously, this is a more appropriate way for user deployment, not
    only that, also can it avoid the risk of inaccuracy in monitoring when
    monitoring operation happen to too many groups at the same time.
    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>
    7d3cd1a2
resctrl.h 4.6 KB