Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: 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>,
	<babu.moger@amd.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: Tue, 17 Nov 2026 11:27:02 +0800	[thread overview]
Message-ID: <1162c8a9-2829-40a4-9ad5-6a526bc57178@huawei.com> (raw)
In-Reply-To: <10f43d19-2994-4ad2-8a49-2891582e32e7@arm.com>



在 2026/11/14 0:14, Ben Horgan 写道:
> Hi Jinjie,
> 
> 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?

Hi Ben,

sashiko also find this problem as below.

Link:
https://sashiko.dev/#/patchset/20261116125914.498841-1-ruanjinjie%40huawei.com

Best regards,
Jinjie

> 
> Thanks,
> 
> Ben
> 
>>
>> Assign the counters when the domain comes online, after its state is
>> set up. Give each enabled MBM event of every group, including the
>> monitor groups under mon_groups/, the counter ID the group uses in
>> another domain, and leave the event unassigned when that ID is already
>> taken on the new domain. Skip groups in pseudo-lock mode, as their RMID
>> has been freed and they are not monitored.
>>
>> A group that has no counter for an event in any domain stays unassigned
>> on the new domain, as it was before. mbm_assign_on_mkdir only applies
>> when a group is created, and counters that the user removed through
>> mbm_L3_assignments stay removed.
>>
>> Fixes: ef712fe97ec5 ("fs/resctrl: Auto assign counters on mkdir and clean up on group removal")
>> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
>> Cc: <stable@vger.kernel.org>
>> Cc: Tony Luck <tony.luck@intel.com>
>> Cc: Reinette Chatre <reinette.chatre@intel.com>
>> Cc: Babu Moger <babu.moger@amd.com>
>> Cc: James Morse <james.morse@arm.com>
>> Cc: Ben Horgan <ben.horgan@arm.com>
>> Cc: Dave Martin <Dave.Martin@arm.com>
>> ---
>> Changes in v2:
>> - Drop the MPAM part of the changelog, the MPAM driver is fixed by
>>   "arm_mpam: resctrl: Use the domain's counter ID".
>> - Link to v1: https://lore.kernel.org/all/20261106094537.2337188-1-ruanjinjie@huawei.com/
> 



      parent reply	other threads:[~2026-11-17  3:27 UTC|newest]

Thread overview: 8+ 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-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-17  3:27     ` Jinjie Ruan [this message]

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=1162c8a9-2829-40a4-9ad5-6a526bc57178@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