Linux Documentation
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Ben Horgan <ben.horgan@arm.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	<tony.luck@intel.com>, <Dave.Martin@arm.com>,
	<james.morse@arm.com>, <babu.moger@amd.com>, <corbet@lwn.net>,
	<skhan@linuxfoundation.org>, <rdunlap@infradead.org>,
	<tglx@kernel.org>, <mingo@redhat.com>, <bp@alien8.de>,
	<dave.hansen@linux.intel.com>, <hpa@zytor.com>,
	<fenghuay@nvidia.com>, <tan.shaopeng@fujitsu.com>,
	<will@kernel.org>, <gshan@redhat.com>, <zengheng4@huawei.com>,
	<jic23@kernel.org>, <x86@kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-doc@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v5 RESEND 5/7] fs/resctrl: Release the limbo RMIDs when the CDP state changes
Date: Wed, 18 Nov 2026 19:20:24 +0800	[thread overview]
Message-ID: <449bb402-9620-493d-9e2b-85d093ad1401@huawei.com> (raw)
In-Reply-To: <7aa50421-6e92-4ea6-be39-88045e682a9f@arm.com>



在 2026/11/13 5:18, Ben Horgan 写道:
> Hi Reinette, Jinjie,
> 
> On 11/11/2026 18:33, Reinette Chatre wrote:
>> Hi Jinjie,
>>
>> On 11/10/26 5:39 AM, Jinjie Ruan wrote:
>>
>>> still carry those RMIDs are accounted to the next user of each RMID.
>>>
>>> The CDP state that matters is the one that changes the PARTIDs used by
>>> the monitors, which is not necessarily the CDP state of the L3
>>> resource. MPAM gives every CLOSID two PARTIDs in all MSCs while CDP is
>>> enabled on any resource, so enabling CDP on L2 alone also changes the
>>> PARTIDs the L3 monitors use. Add resctrl_arch_mon_cdp_enabled() to let
>>> the architecture report this. Only MPAM can be affected, so the RMIDs
>>> are only released where the RMID depends on the CLOSID. On x86 the
>>> RMID does not depend on the CLOSID, and resctrl_arch_mon_cdp_enabled()
>>> returns false.
>>
>> nack. The helper name and value returned on x86 is the first hint that this
>> is not right. For x86 the value is not a statement about x86: CDP exists on
>> x86 and can be enabled, so a function called resctrl_arch_mon_cdp_enabled()
>> returning false reads as wrong until the comment above it explains that what
>> is really being reported is whether CDP changes the IDs the monitors use.
> 
> The invariant that the limbo handler is currently relying on is that the
> mapping of rmid index to the underlying hardware monitor index is fixed.
> For MPAM, if cdp is enabled at all then the mapping is changed and so
> the invariant does not hold between mounts. MPAM's emulation of CDP is
> why it breaks the invariant. resctrl shouldn't need to care about this
> MPAM specific reason and should only care whether or not the invariant
> is upheld or not. In the future, MPAM may use more than the two existing
> indexing schemes. For instance, if we wanted to have one memory
> bandwidth monitor per monitor group, without assignment, then we would
> need to limit the number of monitor groups.
> 
>>
>> Every architecture now needs to match this. This looks more like forcing
>> every architecture to indicate whether it has the same quirk as MPAM.
>>
>> If there is no way to handle this in MPAM driver then handling this should at
>> least be contained between resctrl filesystem and MPAM driver. This should not
>> be forced on all architectures.
> 
> I don't see a way for the MPAM to keep the same RMID for when it is
> emulating CDP and when it's not.
> 
>>
>> I trust the MPAM folks to say whether it can or cannot be done in MPAM driver.
>> If this is not possible in MPAM driver then it looks like this needs to go back
>> to include the L2 CDP check as was done in previous version. With this check 
>> gated by IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID) it does hint "MPAM"
>> but would also need a comment to explain why that is done.
>>
> 
> Would something like an rmid indexing generation count be any better or
> is that just overthinking it?
> 
> int resctrl_arch_rmid_indexing_generation(void);
> 
> If the indexing never changes the arch could always return 1 and if it
> does change the architecture can bump the number on every change. It
> would still never change when resctrl is mounted.

As Renette suggeted, maybe we could include the L2 CDP check as was done
in previous version to make the fix simple?

> 
> Thanks,
> 
> Ben


  reply	other threads:[~2026-11-18 11:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 13:39 [PATCH v5 RESEND 0/7] fs/resctrl: Fix some resctl bugs related to mpam Jinjie Ruan
2026-11-10 13:39 ` [PATCH v5 RESEND 1/7] fs/resctrl: Report a temporary RMID shortage per CLOSID Jinjie Ruan
2026-11-10 13:39 ` [PATCH v5 RESEND 2/7] fs/resctrl: Do not allocate a monitor context when releasing limbo RMIDs Jinjie Ruan
2026-11-12 11:37   ` Ben Horgan
2026-11-10 13:39 ` [PATCH v5 RESEND 3/7] fs/resctrl: Clear the CDP state after the cleanup Jinjie Ruan
2026-11-11 18:27   ` Reinette Chatre
2026-11-12  1:44     ` Jinjie Ruan
2026-11-10 13:39 ` [PATCH v5 RESEND 4/7] fs/resctrl: Stop the limbo handler while resctrl is unmounted Jinjie Ruan
2026-11-11 18:26   ` Reinette Chatre
2026-11-10 13:39 ` [PATCH v5 RESEND 5/7] fs/resctrl: Release the limbo RMIDs when the CDP state changes Jinjie Ruan
2026-11-11 18:33   ` Reinette Chatre
2026-11-12 21:18     ` Ben Horgan
2026-11-18 11:20       ` Jinjie Ruan [this message]
2026-11-18 11:45         ` Ben Horgan
2026-11-10 13:39 ` [PATCH v5 RESEND 6/7] fs/resctrl: Disallow monitor group move when the RMID index changes Jinjie Ruan
2026-11-11 18:33   ` Reinette Chatre
2026-11-10 13:39 ` [PATCH v5 RESEND 7/7] fs/resctrl: Add info/moveable_mon_group Jinjie Ruan
2026-11-11 18:34   ` Reinette Chatre
2026-11-12  1:42     ` Jinjie Ruan
2026-11-12 17:16       ` Ben Horgan

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=449bb402-9620-493d-9e2b-85d093ad1401@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=Dave.Martin@arm.com \
    --cc=babu.moger@amd.com \
    --cc=ben.horgan@arm.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=fenghuay@nvidia.com \
    --cc=gshan@redhat.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=jic23@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=reinette.chatre@intel.com \
    --cc=skhan@linuxfoundation.org \
    --cc=tan.shaopeng@fujitsu.com \
    --cc=tglx@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    --cc=zengheng4@huawei.com \
    /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