From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Babu Moger <babu.moger@amd.com>, Ben Horgan <ben.horgan@arm.com>,
<james.morse@arm.com>, <reinette.chatre@intel.com>,
<fenghuay@nvidia.com>, <tony.luck@intel.com>,
<Dave.Martin@arm.com>, <will@kernel.org>, <jic23@kernel.org>,
<gshan@redhat.com>, <bp@alien8.de>, <x86@kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] fs/resctrl: Give a monitor domain the counters the groups already use
Date: Thu, 19 Nov 2026 10:12:41 +0800 [thread overview]
Message-ID: <a39016a0-4b0a-498c-980f-27e98fcd9725@huawei.com> (raw)
In-Reply-To: <0e3716c3-c537-4f5c-a6a9-3272908b8e86@amd.com>
在 2026/11/18 23:57, Babu Moger 写道:
> Hi Jinjie,
Hi Babu,
>
> On 11/15/26 22:02, Jinjie Ruan wrote:
>>
>>
>> 在 2026/11/14 0:14, Ben Horgan 写道:
>>> Hi Jinjie,
>>
>> Hi Ben,
>>
>>>
>>> On 13/11/2026 08:35, tizi4590 wrote:
>>>> From: Jinjie Ruan <ruanjinjie@huawei.com>
>>>>
>>>> With assignable MBM counters, resctrl can be mounted while all CPUs of
>>>> a monitor domain go offline and one of them comes back, either through
>>>> CPU hotplug or because hibernation takes the non-boot CPUs offline. The
>>>> domain is destroyed and re-created, and the new domain starts with no
>>>> counters assigned. Counters are otherwise only assigned when a group is
>>>> created, when rdtgroup_assign_cntrs() takes a free counter in each
>>>> monitor domain for each MBM event, so no code revisits the groups that
>>>> already exist.
>>>>
>>>> Those groups read "Unassigned" on the new domain, on any system with
>>>> assignable MBM counters. A counter assigned to them later through
>>>> mbm_L3_assignments is the lowest free one in that domain, so the same
>>>> group can end up with a different counter ID on different domains. For
>>>> example, with the counter ID each group uses for mbm_total_bytes and
>>>> "_" for none:
>>>>
>>>> domain 0 domain 1
>>>> mount, mkdir g1 default=0 g1=1 default=0 g1=1
>>>> all CPUs of domain 1 offline default=0 g1=1 (destroyed)
>>>> one CPU of domain 1 online default=0 g1=1 default=_ g1=_
>>>> assign g1 on domain 1 default=0 g1=1 default=_ g1=0
>>>>
>>>> Each domain has its own counters, so g1 can use counter 0 on domain 1
>>>> and counter 1 on domain 0 without affecting the other domain, but until
>>>> it is assigned on domain 1 it reads Unassigned there.
>>>
>>> I brought this up before and it was assessed that no change was
>>> required:
>>> https://lore.kernel.org/lkml/171f92a3-fa2e-44fb-
>>> b0d1-1250c72e31d1@amd.com/
>>>
>>> Do you have any particular reason for wanting this behaviour?
>>
>> I discovered this issue during the testing process and feel it is not
>> very reasonable.
>>
>> This patch doesn't assign anything new - it only restores the counter ID
>> the group already uses on a domain that stayed online.
>>
>> So with the patch, Babu's two cases (`2=e;3=e` and `2=_;3=e`) both come
>> back exactly as they were. The only case it can't know is a group that
>> used a different ID on the domain that went away, and there it leaves
>> the event unassigned rather than guessing.
>
> I see this patch is trying to address two separate issues:
>
> 1. Automatically assigning counters when a domain comes online
>
> I understand the motivation here. It is reasonable to expect counters to
> be assigned when a monitor domain comes online and counters are
> available. However, monitor domain online/offline events are typically
Yes, there was originally a counter available, and after the domain
going offline and coming back online, users still expect it to be available.
> driven by CPU hotplug, hibernation, or other user-initiated actions. In
I agree
> these cases, the user is generally aware of the state transition and can
> explicitly assign counters after the domain is online if monitoring is
> required.
If the power management daemon triggers the sleep mode and no process
with the resctrl permission is involved, the existing monitoring group
in the newly created domain will remain in the unassigned state, causing
the monitoring data to be interrupted.
>
> 2. Retaining the same counter ID across domains
>
> I do not see why this is necessary. The design of assignable MBM
> counters intentionally treats counters as domain-local resources and
> provides flexibility to maximize counter availability across groups.
> Counter IDs are an implementation detail and are not visible to users. A
While fixing the issues related to mpam (the first patch), I also
realized that counters are in-domain resources. I believe this point was
intended to address the mpam issues in the first patch, but it is indeed
unnecessary.
> group using a different counter ID in another domain does not affect
> functionality or monitoring results. Therefore, I do not see a strong
> justification for preserving the same counter ID when a domain is
> recreated. Given the above, I am not convinced the added complexity is
> justified.
>
> Thanks,
>
> Babu
next prev parent reply other threads:[~2026-11-19 2:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 8:35 [PATCH v2 0/2] fs/resctrl: Fix two counter ID bugs tizi4590
2026-11-13 8:35 ` [PATCH v2 1/2] arm_mpam: resctrl: Use the domain's counter ID tizi4590
2026-11-17 11:27 ` Ben Horgan
2026-11-17 11:48 ` Jinjie Ruan
2026-11-17 13:27 ` Ben Horgan
2026-11-18 3:25 ` Jinjie Ruan
2026-11-18 3:22 ` Jinjie Ruan
2026-11-13 8:35 ` [PATCH v2 2/2] fs/resctrl: Give a monitor domain the counters the groups already use tizi4590
2026-11-13 16:14 ` Ben Horgan
2026-11-16 4:02 ` Jinjie Ruan
2026-11-18 15:57 ` Babu Moger
2026-11-19 2:12 ` Jinjie Ruan [this message]
2026-11-17 3:27 ` Jinjie Ruan
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=a39016a0-4b0a-498c-980f-27e98fcd9725@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=fenghuay@nvidia.com \
--cc=gshan@redhat.com \
--cc=james.morse@arm.com \
--cc=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=reinette.chatre@intel.com \
--cc=tony.luck@intel.com \
--cc=will@kernel.org \
--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®