All of lore.kernel.org
 help / color / mirror / Atom feed
From: Babu Moger <babu.moger@amd.com>
To: Reinette Chatre <reinette.chatre@intel.com>,
	tony.luck@intel.com, bp@alien8.de
Cc: x86@kernel.org, Dave.Martin@arm.com, james.morse@arm.com,
	corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org,
	tglx@kernel.org, mingo@redhat.com, dave.hansen@linux.intel.com,
	hpa@zytor.com, kas@kernel.org, rick.p.edgecombe@intel.com,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-coco@lists.linux.dev, kvm@vger.kernel.org
Subject: Re: [PATCH v3 2/3] fs/resctrl: Assign counters to existing groups when enabling mbm_event
Date: Wed, 7 Oct 2026 13:16:30 -0500	[thread overview]
Message-ID: <d40a16dd-2e3f-49b4-a36e-33b0ca8adf3f@amd.com> (raw)
In-Reply-To: <4afdd80e-45cd-4d42-b871-fb25e1fd5fa9@intel.com>

Hi Reinette,

On 10/6/26 12:51, Reinette Chatre wrote:
> Hi Babu,
> 
> On 10/2/26 2:26 PM, Babu Moger wrote:
>> When the user enables counter assignment mode by writing "mbm_event"
>> to /sys/fs/resctrl/info/L3_MON/mbm_assign_mode, resctrl resets all
>> monitoring state and sets mbm_assign_on_mkdir for subsequent mkdir, but
>> does not assign counters to groups that already exist, including the
>> default group created at mount. The counters of those groups return
>> "Unassigned" until the user assigns counters by hand.
> 
> Above summarizes the context and then below follows with the change,
> what makes this deserve a "Fixes:" tag? What is the issue needing fixing?
> 
> 
> Consider, for example:
> 
>        When the user switches counter assignment mode by writing
>        "mbm_event" to /sys/fs/resctrl/info/L3_MON/mbm_assign_mode,
>        resctrl frees all assignable counters, resets per-domain RMID
>        state, and enables counter auto-assignment exposed to user space
>        as mbm_assign_on_mkdir.
> 
>        Even though counter auto-assignment is enabled, groups that
>        already exist at the time of the switch, including the default
>        group created at mount, are not assigned a counter. All MBM
>        events read "Unassigned" until the user assigns a counter by hand.
> 
>        Walk every existing CTRL_MON and its MON children after the reset
>        and assign counters to their MBM events. Enabling "mbm_event" now
>        leaves the same per-group state that auto-assignment would have
>        produced. There may be fewer available counters than MBM events
>        across the existing groups; in that case stop assignment when no
>        counters remain. Events in the remaining groups read "Unassigned",
>        matching the behavior of creating a group when no counters are
>        available.
> 

Looks good. Thanks

>>
>> Enable mbm_assign_on_mkdir and assign counters, while there are some
>> available, to existing CTRL_MON and MON groups so the switch matches
>> mkdir auto-assignment. An event left without a counter reads
>> "Unassigned".
>>
>> Fixes: 8004ea01cf63 ("fs/resctrl: Introduce the interface to switch between monitor modes")
>> Reported-by: Sashiko <sashiko-bot@kernel.org>
>> Closes: https://sashiko.dev/#/patchset/8cb66e18e32e4087a9712c1e68ee6da614efe244.1784322818.git.babu.moger%40amd.com
>> Cc: stable@vger.kernel.org
> 
> tip tag order places "Cc:" after author's SoB.

ack.

> 
>> Signed-off-by: Babu Moger <babu.moger@amd.com>
>> ---
> 
> 
>> diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
>> index 73413cb128ea..fca0734bf346 100644
>> --- a/fs/resctrl/monitor.c
>> +++ b/fs/resctrl/monitor.c
>> @@ -1300,8 +1300,7 @@ static int rdtgroup_assign_cntr_event(struct rdt_l3_mon_domain *d, struct rdtgro
>>   }
>>   
>>   /*
>> - * rdtgroup_assign_cntrs() - Assign counters to MBM events. Called when
>> - *			     a new group is created.
>> + * rdtgroup_assign_cntrs() - Assign counters to MBM events.
> 
> This patch adds another caller of rdtgroup_assign_cntrs() and above thus correctly
> updates the function comments to not just mention the original caller ...
> 
>>    *
>>    * Each group can accommodate two counters per domain: one for the total
>>    * event and one for the local event. Assignments may fail due to the limited
> 
> ... but the detailed function comments trimmed here still considers original
> caller as the only use case and uses original caller to justify why it does not
> need to return an error.
> 
How about this?

/*
  * rdtgroup_assign_cntrs() - Assign counters to MBM events.
  *
  * Each group can accommodate two counters per domain: one for the total
  * event and one for the local event. Assignments may fail due to the 
limited
  * number of counters. However, it is not necessary to return failure.
  * Users have the option to modify the counter assignments later if needed.
  */

Thanks
Ban

  reply	other threads:[~2026-10-07 18:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 21:26 [PATCH v3 0/3] x86,fs/resctrl: Keep default MBM mode at boot and fix ABMC Babu Moger
2026-10-02 21:26 ` [PATCH v3 1/3] x86/resctrl: Fix ABMC counter programming Babu Moger
2026-10-06 17:47   ` Reinette Chatre
2026-10-07 16:33     ` Babu Moger
2026-10-02 21:26 ` [PATCH v3 2/3] fs/resctrl: Assign counters to existing groups when enabling mbm_event Babu Moger
2026-10-06 17:51   ` Reinette Chatre
2026-10-07 18:16     ` Babu Moger [this message]
2026-10-07 22:21       ` Reinette Chatre
2026-10-07 23:45         ` Moger, Babu
2026-10-02 21:26 ` [PATCH v3 3/3] x86,fs/resctrl: Keep mbm_assign_mode in default mode at boot Babu Moger
2026-10-06 17:53   ` Reinette Chatre
2026-10-07 18:54     ` Babu Moger
2026-10-07 22:21       ` Reinette Chatre
2026-10-07 23:47         ` Moger, Babu

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=d40a16dd-2e3f-49b4-a36e-33b0ca8adf3f@amd.com \
    --to=babu.moger@amd.com \
    --cc=Dave.Martin@arm.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=kas@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --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=rick.p.edgecombe@intel.com \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@kernel.org \
    --cc=tony.luck@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.