- 09 4月, 2021 40 次提交
-
-
由 Wang ShaoBo 提交于
hulk inclusion category: bugfix bugzilla: 48265 CVE: NA -------------------------------- This function is called only when we mount resctrl sysfs, for error handling we need to destroy schemata list when next few steps failed after creation of schemata list. Fixes: 7e9b5caeefff ("arm64/mpam: resctrl: Add helpers for init and destroy schemata list") 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: bugfix bugzilla: 48265 CVE: NA -------------------------------- Use fs_context to parse mount options, this old process parsing from parse_rdtgroupfs_options() will be obsoleted and removed. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 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: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Sometimes monitoring will have such anomalies: e.g. > cd /sys/fs/resctrl/ && grep . mon_data/* mon_data/mon_L3CODE_00:14336 mon_data/mon_L3CODE_01:344064 mon_data/mon_L3CODE_02:2048 mon_data/mon_L3CODE_03:27648 mon_data/mon_L3DATA_00:0 #L3DATA's monitoring data always be 0 mon_data/mon_L3DATA_01:0 mon_data/mon_L3DATA_02:0 mon_data/mon_L3DATA_03:0 mon_data/mon_MB_00:392 mon_data/mon_MB_01:552 mon_data/mon_MB_02:160 mon_data/mon_MB_03:0 If cdp on, tasks in resctrl default group with closid=0 and rmid=0 don't know how to fill proper partid_i/pmg_i and partid_d/pmg_d into MPAMx_ELx sysregs by mpam_sched_in() called by __switch_to(), it's because current cpu's default closid and rmid are also equal to 0 and to make the operation modifying configuration passed. Update per cpu default closid of none-zero value, call update_closid_rmid() to update each cpu's mpam proper MPAMx_ELx sysregs for setting partid and pmg when mounting resctrl sysfs, it looks like a practical method. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- MPAM includes partid, pmg, monitor, all of these we collectively call mpam id, if cdp on, we would allocate a new mpamid_new which equals to mpamid + 1, and at some places mpamid may not need to be encapsulated into struct { u16 val; } for simplicity, So we use a simpler macro resctrl_cdp_mpamid_map_val() to complete this cdp mapping process. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- ctrl_features array, introduced by 61fa56e1dd8a ("arm64/mpam: Add resctrl_ctrl_feature structure to manage ctrl features"), which lives in raw_resctrl_resource structure for listing ctrl features's type do we support in total for this resource, this filters illegal parameters outside from mount options and provides useful info for add_schema() for registering a new control type node in schema list. This action helps us to add new ctrl feature easier later. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- rmid is used to mark each resctrl group for monitoring, anyhow, also following corresponding resctrl group's configuration, we export rmid sysfile to resctrl sysfs for any usage elsewhere such as SMMU io, user can get rmid from a resctrl group and set this rmid to a target io through SMMU driver if SMMU MPAM implemented, so make related io devices can be monitored or accomplish aimed configuration for resource's usage. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- So far there are some declarations shared by resctrlfs.c and mpam core module files under kernel/mpam directory scattered in mpam.h and resctrl.h, this is organized like this: -- asm/ +-- resctrl.h + +-- mpam.h | + +-- mpam_resource.h | | + | | | -- fs/ | | +-> mpam/ +-- resctrlfs.c <----+----+------> +-- mpam_resctrl.c ... We move this declarations shared by resctrlfs.c and mpam/ to resctrl.h and split another declarations into mpam_internal.h, also including moving mpam_resource.h to mpam/ directory, currently this is organized like this: -- asm/ +-- mpam.h +----> export to other modules(e.g. SMMU master io) +-- resctrl.h + | -- mpam/ | +-- mpam_internal.h | + +-- mpam_resource.h | | + | | | -- fs/ | +----+-> mpam/ +-- resctrlfs.c <----+-----------> +-- mpam_resctrl.c ... In this way can we build a clearer framework for MPAM usage. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Some resource's properities such as closid and rmid are exported like Intel-RDT in our resctrl design, but there also has two main differences, one is MB(Memory Bandwidth), for we MB is also divided into two directories MB and MB_MON to show respective properties about control and monitor type as same as LxCache, another is we adopt features sysfile under resources' directories, which indicates the properties of control type of corresponding resource, for instance MB hardlimit. e.g. > mount -t resctrl resctrl /sys/fs/resctrl -o mbHdl > cd /sys/fs/resctrl/ && cat info/MB/features mbHdl@1 #indicate MBHDL setting's upper bound is 1 > cat schemata L3:0=7fff;1=7fff;2=7fff;3=7fff MB:0=100;1=100;2=100;3=100 MBHDL:0=1;1=1;2=1;3=1 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Structure resctrl_ctrl_feature taken by resources is introduced to manage ctrl features, of which characteristic like max width from outer input and the base we parse from. Now it is more practical for declaring a new ctrl feature, such as SCHEMA_PRI feature, only associated with internal priority setting exported by mpam devices, where informations is collected from mpam_resctrl_resource_init(), and next be chosen open or close by user options. ctrl_ctrl_feature structure contains a flags field to avoid duplicated control type, for instance, SCHEMA_COMM feature selectes cpbm (Cache portion bitmap) as resource Cache default control type, so we should not enable this feature no longer if user manually selectes cpbm control type through mount options. This field evt in ctrl_ctrl_feature structure is enum rdt_event_id type variable which works like eee4ad2a36e6 ("arm64/mpam: Add hook-events id for ctrl features") illustrates. 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>
-
由 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- So far we use sd_closid, including {reqpartid, intpartid}, to label each resctrl group including ctrlgroup and mongroup, This can perfectly handle this case where number of reqpartid exceeds intpartid, this always happen when intpartid narrowing supported, otherwise their two are of same number. So we use excessive reqpartid to indicate (1)- how configurations can be synchronized from the configuration indexed by intpartid, not only that, (2)- take part of monitor role. But reqpartid in (2) with pmg still be scattered, So far we have not yet a right way to explain how can we use their two properly. In order to ensure their resources can be fully utilized, and given this idea from Intel-RDT's design which uses rmid for monitoring, a rmid remap matrix is delivered for transforming partid and pmg to rmid, this matrix is organized like this: [bitmap entry indexed by partid] [col pos is partid] [0] [1] [2] [3] [4] [5] occ->bitmap[:0] 1 0 0 1 1 1 bitmap[:1] 1 0 0 1 1 1 bitmap[:2] 1 1 1 1 1 1 bitmap[:3] 1 1 1 1 1 1 [row pos-1 is pmg] Calculate rmid = partid + NR_partid * pmg occ represents if this bitmap has been used by a partid, it is because a certain partid should not be accompany with a duplicated pmg for monitoring, this design easily saves a lot of space, and can also decrease time complexity of allocating and free rmid process from O(NR_partid)* O(NR_pmg) to O(NR_partid) + O(log(NR_pmg)) compared with using list. By this way, we get a continuous rmid set with upper bound(NR_pmg * NR_partid - 1), given an rmid we can assume that if it's a valid rmid by judging whether it falls within this range or not. rmid implicts the reqpartid info, so we can use relevant helpers to get this reqpartid for sd_closid@reqpartid and perfectly accomplish this configuration sync mission, this also makes closid simpler which can be consists of intpartid index only, also each resctrl group is happy to own consecutive rmid. This also has some profound influences, for instance for MPAM there also support SMMU io using partid and pmg, we can use a single helper mpam_rmid_to_partid_pmg() in SMMU driver to complete this remap process for rmid input from outside user space. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- There are two aspects involved: - Getting configuration We divide event QOS_XX_PRI_EVENT_ID into QOS_XX_INTPRI_EVENT_ID and QOS_XX_DSPRI_EVENT_ID, in spite of having attempted to set same value of filling dspri and intpti in mpam_config structure but exactly we need read seperately to ensure their independence. Besides, an event such as QOS_CAT_INTPRI_EVENT_ID is not necessary to be read from MSC's register but set to be 0 directly if corresponding feature doesn't support. - Applying configuration When applying downstream or internal priority configuration, given the independence of their two, we should check if feature mpam_feat_ xxpri_part supported first and next check mpam_feat_xxpri_part_0_low, and convert dspri and intpri into a proper value according to it's max width. 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>
-
由 James Morse 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- The MPAM MSC error interrupt tells us how we misconfigured the MSC. We don't expect to to this. If the interrupt fires, print a summary, and mark MPAM as broken. Eventually we will try and cleanly teardown when we see this. Now we can register from a helper mpam_register_device_irq() to register overflow and error interrupt from mpam device, When devices come and go we want to make sure the error irq is enabled. We disable the error irq when cpus are taken offline in case the component remains online even when the associated CPUs are offline. Code of this patch are borrowed from james <james.morse@arm.com>. [Wang ShaoBo: few version adaptation changes] Signed-off-by: NJames Morse <james.morse@arm.com> Link: http://www.linux-arm.org/git?p=linux-jm.git;a=patch;h=6d1ceca3eb5953fc16a524c9aad933519aa3f64c Link: http://www.linux-arm.org/git?p=linux-jm.git;a=patch;h=81d178c198165fd557431d6879135d2e03ea92c0Signed-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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- MPAM spec says, when an MPAMCFG register other than MPAMCFG_INTPARTID is read or written, if the value of MPAMCFG_PART_SEL.INTERNAL is not 1, MPAMF_ESR is set to indicate an intPARTID_Range error. So we should set MPAMCFG_PART_SEL.INTERNAL to 1 before reading MPAMCFG_PRI register. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- If cdp enabled, LxCODE and LxDATA are assigned two different partid each occupies a monitor, but because not all features use cdp mode, for instance MB(Memory Bandwidth), we should make sure this two partid/ monitor be operated simultaneously for display. e.g. +- code stream (partid = 0, monitor = 0) ----+---> L3CODE cpu-+ + +- data stream (partid = 1, monitor = 1) ----+---> L3DATA | +---> MB 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Reading/Writing registers directly for getting or putting configuration is not friendly with expansion and legibility, multiple types of schemata ctrls is supported, of which value should be converted to a proper value based on specific definition and range in corresponding register according to MPAM spec, Using event id instead to indicate which type configuration we want to get looks easier for us. Besides, different hook-events have different setting bound such as bwa_wd for adaptive range conversion when writing configuration, this can be associated with specific event for conversion. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- MPAMCFG_INTPARTID.INTERNAL must be set when narrowing reqpartid to intpartid according to MPAM spec definitions, and this action must be done before writing MPAMCFG_PART_SEL if narrowing implemented. So we plan this work that do narrowing unifiedly when narrowing is supported. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Use an array for storing extend ctrls' max width, on purpose, checking each input value from schemata. Note the useful value of each ctrls' max width is at least 1, 0 means meaningless, and greater than 1 means the choices can be selected. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Store default priority in mpam class structure from reading devices' intpri_wd and dspri_wd. intpri_wd and dspri_wd represent the number of implemented bits in the internal/downstream priority field in MPAMCFG_PRI, when INTPRI_0_IS_LOW /DSPRI_0_IS_LOW is not set, we need to rotate input priority(higher value higher priority) from user space to target priority (higher value lower priority) and this is restricted by implemented bits. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Register MPAMCFG_PRI's default value is also used for software default usage after probing resources, two fields hwdef_intpri and hwdef_dspri are placed into mpam_device structure to store the default priority setting. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Currently configuration control type is devided into three classes: COMMON, PRIORITY and HARDLIMIT, capacities' features for mount options is stored in ctrl_extend_bits field live in resctrl resource structure to figure out which configuration type is allowed to apply, when writing schemata sysfile, all related configurations' content from corresponding configuration array will be updated and applied once time. we can set configuration like this: e.g. > mount -t resctrl resctrl /sys/fs/resctrl && cd /sys/fs/resctrl -o hardlimit > cat schemata L3:0=7fff;1=7fff;2=7fff;3=7fff MB:0=100;1=100;2=100;3=100 MBHDL:0=1;1=1;2=1;3=1 > echo 'MB:0=10' > schemata && echo 'MBHDL:0=0' > schemata # no hardlimit This also deletes opt_list no longer needed that used as organizing different control types, now we can check supports from ctrl_extend_bits and do extended control-type works by schema list. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- So far each mon group is tagged by sd_closid, we can monitor data by switching cpus' sd_closid.reqpartid and pmg, and ensuring consistent configuration for mon groups by following it's parent ctrl group through sd_closid.intpartid. Most of this code is borrowed from Intel-RDT. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- For each ctrl group, it's monitoring data should include all it's child mon groups' monitoring data, these code is borrowed from Intel-RDT for facilitating users to configure different monitoring strategies. 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>
-
由 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- According to Arm MPAM spec definition, register MPAMCFG_PART_SEL's high 16 bit should be set to 0 and MPAMCFG_INTPARTID's high 16 bit should be set to 1 when establishing intpartid association, and we should use intpartid in MPAMCFG_PART_SEL instead of reqpartid as long as intpartid narrowing is implemented. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Code in resctrlfs.c is not shared with x86 RDT currently, but may be updated to support both in the future, so remove unrelated CONFIG for now to make code clearer. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- We redesign monitoring process for user, as following illustrates: e.g. before rewriting: mount /sys/fs/resctrl && cd /sys/fs/resctrl mkdir p1 && cd p1 echo 1 > ctrlmon # this allocates a monitor resource for this group ... # associating task/cpu with this group grep . mon_data/* # get monitor data from mon_data directory e.g. after rewriting: mount /sys/fs/resctrl && cd /sys/fs/resctrl mkdir p1 && cd p1 # automically allocating a monitoring resource ... # associate task/cpu with this group grep . mon_data/* # directly get monitor data ctrlmon is used for manually allocating a monitor resource for monitoring a specified group (labeled by partid and pmg), we delete ctrlmon because this action is redundant. User should know which group has been allocated a available monitor resource and only this monitor resource is released then this monitor resource can be reallocated to a new group after, this action is redundant and unnecessary, as monitor resource is used only when monitoring process happens, so a relax monitor resource can be allocated to multiple groups and take effect when monitoring process happened. But should some restrictions be known, a monitor resource for monitoring Cache-occupancy might be kept for a long time until it doesn't need to be use anymore, or below a threshold as like intel-RDT limbo list works, otherwise you may see that the monitoring result is very small beyond exception when you force switch one mon resource from one group to another. We deliver a simple LRU mon resource allocation mechanism, but so far it just assign a monitor according to the order in which groups was created, this is incomplete and needs subsequent improvement. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Rearrange helpers' declaration place for resctrlfs and clean up header files included, this make code more clear. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- commit 43be0de7be8f ("arm64/mpam: Support cdp on allocating monitors") allows us to allocate two monitor once, we apply this two monitors to different monitor sysfile under mon_data directory according to its' closid, as following illustrates. -- resctrl/ +-- schemata L3CODE:0=xx # closid L3DATA:1=xx # closid+1 MB:0=xx # closid +-- mon_data/ +-- mon_L3CODE_00 # monitor +-- mon_L3DATA_00 # monitor+1 +-- mon_MB_00 # monitor When monitoring happens, we read the private data of each monitor sysfile which contains closid, monitor and pmg, this is used for obtaining monitor data. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- This prepares for simultaneously monitoring LxDATA and LxCODE when cdp is open, under our implementation, LxDATA and LxCODE is allocated closid and closid+1, so we should keep two monitor once time for each. Why there needs one monitors for each closid when cdp is open, but not switch one between the two LxDATA and LxCODE is because this monitor kept by target closid maybe busy for a long time, it would cause inaccuracy if we force 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Resctrl ctrlmon write/read functions should be moved to mpam_ctrlmon.c to make code clear. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Replace u32 bitmask with bitmap for closid allocation, it's because closid may be too large to use 32 bits. This also support cdp, when cdp is enabled, closid will be assigned twice once time, giving closid to code LxCache and closid+1 to data LxDATA, so do free process. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- resctrl_resource_reset() would be excuted if resctrl sysfs umount, this help to reset all settings stored in related structures (such as mpam_cfg) and put MSCs back to default state. This is similar to 6ab0b81f2c18 ("arm64/mpam: Fix unreset resources when mkdir ctrl group or umount resctrl") but using helpers from mpam devices module. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- For MPAM, Processing elements (PEs) issue memory-system requests, PEs must implement the MPAMn_ELx registers and their behaviors to generate the PARTID and PMG fields of memory-system requests. So far schemata supports cdp writing and reading, to grab MPAM info from cpu for downstream MSCs, SYS_MPAMx_ELx registers should be filled in both partid_d and partid_i (mapped from closids) of LxDATA and LxCODE and pmg_d and pmg_i (mapped from rmid). 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- schemata labels each row with hw_closid, which can be parsed into closid according to fixed rules (LxCODE and MBA are given closid, LxDATA is given to closid + 1), so the maximum number of rdtgroup can be created is also restricted by half if cdp enabled. The length of Lx Cache domains displayed in schemata is compressed, this is because for specified hardware platform, domains of each resource may be too many to be easily operated for user interaction. This patch also move parse_cbm() and parse_bw() to mpam_resctrl.c for clarity. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Add a schema list for each rdt domain, we use this list to store changes from schemata row instead of previous ctrlval array live in resctrl resource structure, when mounting resctrl sysfs happened, we would reset all resource's configuration into default by resctrl_group_update_domains(). Currently each row in schemata sysfile occupy a list node, this may be extended for perfecting control types. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- Initialize schemata list when mount resctrl sysfs and destroy it when umount, each list node contains the value updated by schemata (in resctrl sysfs) row. Partial code is borrowed from 250656171d95 ("x86/resctrl: Stop using Lx CODE/DATA resources"), as it illustrates: Now that CDP enable/disable is global, and the closid offset correction is based on the configuration being applied, we are using different hw_closid slots in the ctrl array for CODE/DATA schema. This lets us merge them using the same Lx resource twice for CDP's CODE/DATA schema. This keeps the illusion of separate caches in the resctrl code. When CDP is enabled for a cache, create two schema generating the names and setting the configuration type. We can now remove the initialisation of the illusionary hw_resources: 'cdp_capable' just requires setting a flag, resctrl knows what to do from there. Link: http://www.linux-arm.org/git?p=linux-jm.git;a=commit;h=250656171d95dea079cc661098a0984e7237aa25Signed-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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- This supports cdpl2,cdpl3 parameters for mount options, some other options including capabilities' feature such as priority and hardlimit will be supported in the future, a simple example like this. e.g. > mount -t resctrl resctrl /sys/fs/resctrl -o cdpl3 > cd /sys/fs/resctrl && cat schemata L3CODE:0=7fff;1=7fff;2=7fff;3=7fff L3CODE:0=7fff;1=7fff;2=7fff;3=7fff MB:0=100;1=100;2=100;3=100 Note that we only complete this part interface adaption, not mean cdp is supported currently. 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>
-
由 Wang ShaoBo 提交于
hulk inclusion category: feature feature: ARM MPAM support bugzilla: 48265 CVE: NA -------------------------------- CDP (Code and Data Prioritization) should also be supported, because separate code and data caches is an illusion resctrl creates using CDP, as James said, The L2 cache is controlled from one place regardless. Arm doesn't specify a cache topology. Platforms may have separate L2 code and data caches, with independent controls. On such a system we would need a unified L2 cache to be an illusion. To support Arm's MPAM, we need CDP to not be implicit between the architecture code and the file-system code. this add a series definitions independent of resctrl resources. To do this we make the code/data/both 'type' a property of the configuration that comes from the schema. This lets us combined the illusionary cache. Eventually we separate the architecture code and file-system code's idea of closid, the architecture code can then provide helpers to map one to the other. Part of this code is borrowed to James's, See links. Link: http://www.linux-arm.org/git?p=linux-jm.git;a=commit;h=57a6f6204f72e2afc116721b2b86451fa19a32a6 Link: http://www.linux-arm.org/git?p=linux-jm.git;a=commit;h=1385052cce87a8aed5dc0e96967cedd9e74a17e0Signed-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>
-