mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zeng Heng <zengheng4@huawei.com>
To: "Shaopeng Tan (Fujitsu)" <tan.shaopeng@fujitsu.com>,
	"'ben.horgan@arm.com'" <ben.horgan@arm.com>,
	"'james.morse@arm.com'" <james.morse@arm.com>,
	"'Dave.Martin@arm.com'" <Dave.Martin@arm.com>,
	"'reinette.chatre@intel.com'" <reinette.chatre@intel.com>,
	"'fenghuay@nvidia.com'" <fenghuay@nvidia.com>
Cc: "'dave.hansen@linux.intel.com'" <dave.hansen@linux.intel.com>,
	"'tglx@kernel.org'" <tglx@kernel.org>,
	"'mingo@redhat.com'" <mingo@redhat.com>,
	"'hpa@zytor.com'" <hpa@zytor.com>,
	"'bp@alien8.de'" <bp@alien8.de>,
	"'tony.luck@intel.com'" <tony.luck@intel.com>,
	"'babu.moger@amd.com'" <babu.moger@amd.com>,
	"'x86@kernel.org'" <x86@kernel.org>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	"'wangkefeng.wang@huawei.com'" <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v3 3/9] arm_mpam: Disable Narrow-PARTID when MBA lacks support
Date: Mon, 13 Apr 2026 17:12:55 +0800	[thread overview]
Message-ID: <aa34d6b4-99df-6d6c-737d-52e03e5af577@huawei.com> (raw)
In-Reply-To: <30d37733-db55-f29f-5bbf-1b69ed0846e5@huawei.com>

Hi Shaopeng,

On 2026/4/11 14:50, Zeng Heng wrote:
> 
> 
> On 2026/4/10 9:07, Shaopeng Tan (Fujitsu) wrote:
>> Hello Zeng Heng,
>>
>>> MPAM supports mixed systems with MSCs that may or may not implement
>>> Narrow-PARTID. However, when the MBA MSC uses percentage-based
>>> throttling (non-bitmap partition control) and lacks Narrow-PARTID 
>>> support,
>>> resctrl cannot correctly apply control group configurations across 
>>> multiple
>>> PARTIDs.
>>>
>>> Since there is no straightforward way to program compatible control 
>>> values in
>>> this scenario, disable Narrow-PARTID system-wide when detected. The
>>> detection occurs at initialization time on the first call to 
>>> get_num_reqpartid()
>>> from mpam_resctrl_pick_counters(), which is guaranteed to occur after
>>> mpam_resctrl_pick_mba() has set up the MBA resource class.
>>>
>>> If MBA MSCs lack Narrow-PARTID support, get_num_reqpartid() falls 
>>> back to
>>> returning the number of internal PARTIDs (mpam_intpartid_max).
>>>
>>> Signed-off-by: Zeng Heng <zengheng4@huawei.com>
>>> ---
>>>   drivers/resctrl/mpam_resctrl.c | 38
>>> +++++++++++++++++++++++++++++++++-
>>>   1 file changed, 37 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/resctrl/mpam_resctrl.c 
>>> b/drivers/resctrl/mpam_resctrl.c
>>> index 222ea1d199e1..1b18c095cfce 100644
>>> --- a/drivers/resctrl/mpam_resctrl.c
>>> +++ b/drivers/resctrl/mpam_resctrl.c
>>> @@ -240,9 +240,45 @@ u32 resctrl_arch_get_num_closid(struct rdt_resource
>>> *ignored)
>>>       return mpam_intpartid_max + 1;
>>>   }
>>>
>>> +/*
>>> + * Determine the effective number of PARTIDs available for resctrl.
>>> + *
>>> + * This function performs a one-time check to determine if
>>> +Narrow-PARTID
>>> + * can be used. It must be called after mpam_resctrl_pick_mba() has
>>> + * initialized the MBA resource, as the MBA class properties are used
>>> + * to detect Narrow-PARTID support.
>>> + *
>>> + * The first call occurs in mpam_resctrl_pick_counters(), ensuring the
>>> + * prerequisite initialization is complete.
>>> + */
>>> +static u32 get_num_reqpartid(void)
>>> +{
>>> +    struct mpam_resctrl_res *res;
>>> +    struct rdt_resource *r_mba;
>>> +    struct mpam_props *cprops;
>>> +    static bool first = true;
>>> +
>>> +    if (first) {
>>> +        r_mba = resctrl_arch_get_resource(RDT_RESOURCE_MBA);
>>> +        res = container_of(r_mba, struct mpam_resctrl_res,
>>> resctrl_res);
>>> +        if (!res->class)
>>> +            goto out;
>>> +
>>> +        /* If MBA MSCs lack Narrow-PARTID support, roll back. */
>>> +        cprops = &res->class->props;
>>> +        if (!mpam_has_feature(mpam_feat_partid_nrw, cprops))
>>> +            mpam_partid_max = mpam_intpartid_max;
>>
>> Isn't max reqpartid stored in mpam_partid_max? Why is a rollback 
>> necessary?
>>
> 
> "In order to be able to assign multiple reqPARTIDs freely to resource
> control groups, it is necessary that all MSCs that are used by resctrl
> either implement Narrow PARTID (so that PARTIDs can be remapped
> explicitly) or otherwise only have controls whose resource regulation
> is stateless and so whose behaviour would not be affected by splitting
> a control group across multiple PARTIDs."
> 
> 

I've rewritten the commit message in an attempt to explain this more
clearly:
https://lore.kernel.org/all/20260413085405.1166412-4-zengheng4@huawei.com/


Thanks for your review in advance,
Zeng Heng

  reply	other threads:[~2026-04-13  9:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17 13:21 [PATCH v3 0/9] arm_mpam: Introduce Narrow-PARTID feature Zeng Heng
2026-03-17 13:21 ` [PATCH v3 1/9] fs/resctrl: Fix MPAM Partid parsing errors by preserving CDP state during umount Zeng Heng
2026-03-20 17:07   ` Ben Horgan
2026-03-21  4:11     ` Zeng Heng
2026-03-21  6:39       ` Zeng Heng
2026-03-17 13:21 ` [PATCH v3 2/9] arm_mpam: Add intPARTID and reqPARTID support for narrow PARTID feature Zeng Heng
2026-03-17 13:21 ` [PATCH v3 3/9] arm_mpam: Disable Narrow-PARTID when MBA lacks support Zeng Heng
2026-04-10  1:07   ` Shaopeng Tan (Fujitsu)
2026-04-11  6:50     ` Zeng Heng
2026-04-13  9:12       ` Zeng Heng [this message]
2026-03-17 13:21 ` [PATCH v3 4/9] arm_mpam: Refactor rmid to reqPARTID/PMG mapping Zeng Heng
2026-03-17 13:21 ` [PATCH v3 5/9] arm_mpam: Propagate control group config to sub-monitoring groups Zeng Heng
2026-03-17 13:21 ` [PATCH v3 6/9] fs/resctrl: Add rmid_entry state helpers Zeng Heng
2026-03-17 13:21 ` [PATCH v3 7/9] arm_mpam: Implement dynamic reqPARTID allocation for monitoring groups Zeng Heng
2026-03-17 13:21 ` [PATCH v3 8/9] fs/resctrl: Wire up rmid expansion and reclaim functions Zeng Heng
2026-03-17 13:21 ` [PATCH v3 9/9] arm64/mpam: Add mpam_sync_config() for dynamic rmid expansion Zeng Heng
2026-03-20 16:14 ` [PATCH v3 0/9] arm_mpam: Introduce Narrow-PARTID feature Ben Horgan
2026-03-21  7:18   ` Zeng Heng
2026-04-10  0:13 ` Shaopeng Tan (Fujitsu)
2026-04-11  6:32   ` Zeng Heng
2026-04-16  6:11     ` Shaopeng Tan (Fujitsu)
2026-04-20  8:19       ` Zeng Heng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa34d6b4-99df-6d6c-737d-52e03e5af577@huawei.com \
    --to=zengheng4@huawei.com \
    --cc=Dave.Martin@arm.com \
    --cc=babu.moger@amd.com \
    --cc=ben.horgan@arm.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=fenghuay@nvidia.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=reinette.chatre@intel.com \
    --cc=tan.shaopeng@fujitsu.com \
    --cc=tglx@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®