* [PATCH v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry
@ 2026-02-04 16:19 Ben Horgan
2026-02-05 16:04 ` Reinette Chatre
2026-03-01 10:49 ` Borislav Petkov
0 siblings, 2 replies; 7+ messages in thread
From: Ben Horgan @ 2026-02-04 16:19 UTC (permalink / raw)
To: linux-kernel
Cc: tony.luck, reinette.chatre, Dave.Martin, james.morse, babu.moger,
bp, Ben Horgan
Commit
3b497c3f4f04 ("fs/resctrl: Introduce the interface to display monitoring modes")
introduced CONFIG_RESCTRL_ASSIGN_FIXED but left adding the Kconfig entry
until it was necessary.
Add CONFIG_RESCTRL_ASSIGN_FIXED in order to support MPAM where the counter
assignment mode is indeed fixed.
CONFIG_RESCTRL_ASSIGN_FIXED is a resctrl fs Kconfig option so handle
attempts to modify counter assignment mode when it is enabled in resctrl fs
rather than delegating to arch specific code.
Signed-off-by: Ben Horgan <ben.horgan@arm.com>
---
Changes since v1:
Update the commit message to make it clear this is an anticipated follow on
patch rather than a fix.
Only fail attempts to change to a different counter assignment mode.
Kconfig indenting.
Use "counter assignment mode" text throughout.
Changes since v2:
Start user message with a capital
Make summary more succinct - was
"fs/resctrl: Add missing kconfig entry for CONFIG_RESCTRL_ASSIGN_FIXED"
Tidy changelog
Changes since v3:
Add middle paragraph in changelog
---
fs/resctrl/Kconfig | 9 +++++++++
fs/resctrl/monitor.c | 6 ++++++
2 files changed, 15 insertions(+)
diff --git a/fs/resctrl/Kconfig b/fs/resctrl/Kconfig
index 21671301bd8a..d833dea81aea 100644
--- a/fs/resctrl/Kconfig
+++ b/fs/resctrl/Kconfig
@@ -37,3 +37,12 @@ config RESCTRL_RMID_DEPENDS_ON_CLOSID
Enabled by the architecture when the RMID values depend on the CLOSID.
This causes the CLOSID allocator to search for CLOSID with clean
RMID.
+
+config RESCTRL_ASSIGN_FIXED
+ bool
+ depends on RESCTRL_FS
+ help
+ Enabled by the architecture when the counter assignment mode is not
+ configurable. This ensures that counter assignment mode is not
+ advertised as configurable and attempts to change counter assignment
+ mode fail.
diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
index 572a9925bd6c..4e9f55ee3267 100644
--- a/fs/resctrl/monitor.c
+++ b/fs/resctrl/monitor.c
@@ -1451,6 +1451,12 @@ ssize_t resctrl_mbm_assign_mode_write(struct kernfs_open_file *of, char *buf,
}
if (enable != resctrl_arch_mbm_cntr_assign_enabled(r)) {
+ if (IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED)) {
+ ret = -EINVAL;
+ rdt_last_cmd_puts("Counter assignment mode is not configurable\n");
+ goto out_unlock;
+ }
+
ret = resctrl_arch_mbm_cntr_assign_set(r, enable);
if (ret)
goto out_unlock;
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry
2026-02-04 16:19 [PATCH v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry Ben Horgan
@ 2026-02-05 16:04 ` Reinette Chatre
2026-03-01 10:49 ` Borislav Petkov
1 sibling, 0 replies; 7+ messages in thread
From: Reinette Chatre @ 2026-02-05 16:04 UTC (permalink / raw)
To: Ben Horgan, linux-kernel
Cc: tony.luck, Dave.Martin, james.morse, babu.moger, bp,
x86@kernel.org
+ x86 Maintainers
Hi Ben,
On 2/4/26 8:19 AM, Ben Horgan wrote:
> Commit
>
> 3b497c3f4f04 ("fs/resctrl: Introduce the interface to display monitoring modes")
>
> introduced CONFIG_RESCTRL_ASSIGN_FIXED but left adding the Kconfig entry
> until it was necessary.
>
> Add CONFIG_RESCTRL_ASSIGN_FIXED in order to support MPAM where the counter
> assignment mode is indeed fixed.
>
> CONFIG_RESCTRL_ASSIGN_FIXED is a resctrl fs Kconfig option so handle
> attempts to modify counter assignment mode when it is enabled in resctrl fs
> rather than delegating to arch specific code.
>
> Signed-off-by: Ben Horgan <ben.horgan@arm.com>
> ---
Thank you.
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Reinette
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry
2026-02-04 16:19 [PATCH v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry Ben Horgan
2026-02-05 16:04 ` Reinette Chatre
@ 2026-03-01 10:49 ` Borislav Petkov
2026-03-02 10:02 ` Ben Horgan
1 sibling, 1 reply; 7+ messages in thread
From: Borislav Petkov @ 2026-03-01 10:49 UTC (permalink / raw)
To: Ben Horgan
Cc: linux-kernel, tony.luck, reinette.chatre, Dave.Martin,
james.morse, babu.moger
On Wed, Feb 04, 2026 at 04:19:52PM +0000, Ben Horgan wrote:
> diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
> index 572a9925bd6c..4e9f55ee3267 100644
> --- a/fs/resctrl/monitor.c
> +++ b/fs/resctrl/monitor.c
> @@ -1451,6 +1451,12 @@ ssize_t resctrl_mbm_assign_mode_write(struct kernfs_open_file *of, char *buf,
> }
>
> if (enable != resctrl_arch_mbm_cntr_assign_enabled(r)) {
> + if (IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED)) {
Does it need to be a Kconfig entry or you can figure out programatically from
the architecture that that is the case and avoid yet another CONFIG_ knob?
From reading this, I'm thinking
if (IS ARM64) {
should do or...?
> + ret = -EINVAL;
> + rdt_last_cmd_puts("Counter assignment mode is not configurable\n");
> + goto out_unlock;
> + }
> +
> ret = resctrl_arch_mbm_cntr_assign_set(r, enable);
> if (ret)
> goto out_unlock;
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry
2026-03-01 10:49 ` Borislav Petkov
@ 2026-03-02 10:02 ` Ben Horgan
2026-03-02 23:32 ` Reinette Chatre
0 siblings, 1 reply; 7+ messages in thread
From: Ben Horgan @ 2026-03-02 10:02 UTC (permalink / raw)
To: Borislav Petkov
Cc: linux-kernel, tony.luck, reinette.chatre, Dave.Martin,
james.morse, babu.moger
Hi Boris,
On 3/1/26 10:49, Borislav Petkov wrote:
> On Wed, Feb 04, 2026 at 04:19:52PM +0000, Ben Horgan wrote:
>> diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
>> index 572a9925bd6c..4e9f55ee3267 100644
>> --- a/fs/resctrl/monitor.c
>> +++ b/fs/resctrl/monitor.c
>> @@ -1451,6 +1451,12 @@ ssize_t resctrl_mbm_assign_mode_write(struct kernfs_open_file *of, char *buf,
>> }
>>
>> if (enable != resctrl_arch_mbm_cntr_assign_enabled(r)) {
>> + if (IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED)) {
>
> Does it need to be a Kconfig entry or you can figure out programatically from
> the architecture that that is the case and avoid yet another CONFIG_ knob?
>
> From reading this, I'm thinking
>
> if (IS ARM64) {
>
> should do or...?
Yes, we don't necessarily need the Kconfig and we don't necessarily need this condition at all in
resctrl_mbm_assign_mode_write(), we do need the existing one in resctrl_mbm_assign_mode_show() though.
The Kconfig was effectively added in:
commit 3b497c3f4f04 ("fs/resctrl: Introduce the interface to display monitoring modes")
and I was just filling in the missing piece. Most arch specific things in resctrl seem
to be dealt with using resctrl_arch_* hooks. Would it be preferable to create a new one of these?
It could be resctrl_arch_mbm_cntr_assign_fixed() although we seem to be getting too many
of these too. Perhaps we could extend the meaning of another hook, resctrl_arch_mbm_assign_set() could
return -EOPNOTSUPP to indicate to resctrl that the counter assignment mode is not configurable.
>
>> + ret = -EINVAL;
>> + rdt_last_cmd_puts("Counter assignment mode is not configurable\n");
>> + goto out_unlock;
>> + }
>> +
>> ret = resctrl_arch_mbm_cntr_assign_set(r, enable);
>> if (ret)
>> goto out_unlock;
>
Thanks,
Ben
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry
2026-03-02 10:02 ` Ben Horgan
@ 2026-03-02 23:32 ` Reinette Chatre
2026-03-03 14:24 ` Ben Horgan
0 siblings, 1 reply; 7+ messages in thread
From: Reinette Chatre @ 2026-03-02 23:32 UTC (permalink / raw)
To: Ben Horgan, Borislav Petkov
Cc: linux-kernel, tony.luck, Dave.Martin, james.morse, babu.moger
Hi Ben,
On 3/2/26 2:02 AM, Ben Horgan wrote:
> Hi Boris,
>
> On 3/1/26 10:49, Borislav Petkov wrote:
>> On Wed, Feb 04, 2026 at 04:19:52PM +0000, Ben Horgan wrote:
>>> diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
>>> index 572a9925bd6c..4e9f55ee3267 100644
>>> --- a/fs/resctrl/monitor.c
>>> +++ b/fs/resctrl/monitor.c
>>> @@ -1451,6 +1451,12 @@ ssize_t resctrl_mbm_assign_mode_write(struct kernfs_open_file *of, char *buf,
>>> }
>>>
>>> if (enable != resctrl_arch_mbm_cntr_assign_enabled(r)) {
>>> + if (IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED)) {
>>
>> Does it need to be a Kconfig entry or you can figure out programatically from
>> the architecture that that is the case and avoid yet another CONFIG_ knob?
>>
>> From reading this, I'm thinking
>>
>> if (IS ARM64) {
>>
>> should do or...?
>
> Yes, we don't necessarily need the Kconfig and we don't necessarily need this condition at all in
> resctrl_mbm_assign_mode_write(), we do need the existing one in resctrl_mbm_assign_mode_show() though.
It is not obvious to me why the one in resctrl_mbm_assign_mode_show() is required if
a new arch helper could suffice in other parts
>
> The Kconfig was effectively added in:
>
> commit 3b497c3f4f04 ("fs/resctrl: Introduce the interface to display monitoring modes")
>
> and I was just filling in the missing piece. Most arch specific things in resctrl seem
> to be dealt with using resctrl_arch_* hooks. Would it be preferable to create a new one of these?
It looks to me as though this patch fits in with the other series you posted at
https://lore.kernel.org/lkml/20260225201905.3568624-1-ben.horgan@arm.com/
When looking at this patch together with the other series there may indeed be an arch
helper that can replace CONFIG_RESCTRL_ASSIGN_FIXED but as I mentioned in that series
the MPAM capabilities and strategies for resctrl to support them are not clear to me
at this time.
> It could be resctrl_arch_mbm_cntr_assign_fixed() although we seem to be getting too many
> of these too. Perhaps we could extend the meaning of another hook, resctrl_arch_mbm_assign_set() could
Could you please elaborate which category of helper is getting to be too many? We can surely
explore improvements.
> return -EOPNOTSUPP to indicate to resctrl that the counter assignment mode is not configurable.
>
Reinette
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry
2026-03-02 23:32 ` Reinette Chatre
@ 2026-03-03 14:24 ` Ben Horgan
2026-03-03 16:58 ` Reinette Chatre
0 siblings, 1 reply; 7+ messages in thread
From: Ben Horgan @ 2026-03-03 14:24 UTC (permalink / raw)
To: Reinette Chatre
Cc: Borislav Petkov, linux-kernel, tony.luck, Dave.Martin,
james.morse, babu.moger
Hi Reinette,
On Mon, Mar 02, 2026 at 03:32:39PM -0800, Reinette Chatre wrote:
> Hi Ben,
>
> On 3/2/26 2:02 AM, Ben Horgan wrote:
> > Hi Boris,
> >
> > On 3/1/26 10:49, Borislav Petkov wrote:
> >> On Wed, Feb 04, 2026 at 04:19:52PM +0000, Ben Horgan wrote:
> >>> diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
> >>> index 572a9925bd6c..4e9f55ee3267 100644
> >>> --- a/fs/resctrl/monitor.c
> >>> +++ b/fs/resctrl/monitor.c
> >>> @@ -1451,6 +1451,12 @@ ssize_t resctrl_mbm_assign_mode_write(struct kernfs_open_file *of, char *buf,
> >>> }
> >>>
> >>> if (enable != resctrl_arch_mbm_cntr_assign_enabled(r)) {
> >>> + if (IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED)) {
> >>
> >> Does it need to be a Kconfig entry or you can figure out programatically from
> >> the architecture that that is the case and avoid yet another CONFIG_ knob?
> >>
> >> From reading this, I'm thinking
> >>
> >> if (IS ARM64) {
> >>
> >> should do or...?
> >
> > Yes, we don't necessarily need the Kconfig and we don't necessarily need this condition at all in
> > resctrl_mbm_assign_mode_write(), we do need the existing one in resctrl_mbm_assign_mode_show() though.
>
> It is not obvious to me why the one in resctrl_mbm_assign_mode_show() is required if
> a new arch helper could suffice in other parts
I think a new arch helper could cover both.
>
> >
> > The Kconfig was effectively added in:
> >
> > commit 3b497c3f4f04 ("fs/resctrl: Introduce the interface to display monitoring modes")
> >
> > and I was just filling in the missing piece. Most arch specific things in resctrl seem
> > to be dealt with using resctrl_arch_* hooks. Would it be preferable to create a new one of these?
>
> It looks to me as though this patch fits in with the other series you posted at
> https://lore.kernel.org/lkml/20260225201905.3568624-1-ben.horgan@arm.com/
>
> When looking at this patch together with the other series there may indeed be an arch
> helper that can replace CONFIG_RESCTRL_ASSIGN_FIXED but as I mentioned in that series
> the MPAM capabilities and strategies for resctrl to support them are not clear to me
> at this time.
If you like, I can drop this patch and tag a resctrl_arch_ hook based hook
version on to that series when I respin. Do you prefer a new hook,
resctrl_arch_mbm_cntr_assign_fixed(), or using/abusing the error return of
resctrl_arch_mbm_assign_set()?
>
>
> > It could be resctrl_arch_mbm_cntr_assign_fixed() although we seem to be getting too many
> > of these too. Perhaps we could extend the meaning of another hook, resctrl_arch_mbm_assign_set() could
>
> Could you please elaborate which category of helper is getting to be too many? We can surely
> explore improvements.
Nothing major or anything that necessarily needs to change. Just that for each
new feature we get a few new resctrl_arch_* and they all need to be updated in
the MPAM driver even if the feature isn't used.
>
> > return -EOPNOTSUPP to indicate to resctrl that the counter assignment mode is not configurable.
> >
>
> Reinette
>
Thanks,
Ben
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry
2026-03-03 14:24 ` Ben Horgan
@ 2026-03-03 16:58 ` Reinette Chatre
0 siblings, 0 replies; 7+ messages in thread
From: Reinette Chatre @ 2026-03-03 16:58 UTC (permalink / raw)
To: Ben Horgan
Cc: Borislav Petkov, linux-kernel, tony.luck, Dave.Martin,
james.morse, babu.moger
Hi Ben,
On 3/3/26 6:24 AM, Ben Horgan wrote:
> Hi Reinette,
>
> On Mon, Mar 02, 2026 at 03:32:39PM -0800, Reinette Chatre wrote:
>> Hi Ben,
>>
>> On 3/2/26 2:02 AM, Ben Horgan wrote:
>>> Hi Boris,
>>>
>>> On 3/1/26 10:49, Borislav Petkov wrote:
>>>> On Wed, Feb 04, 2026 at 04:19:52PM +0000, Ben Horgan wrote:
>>>>> diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
>>>>> index 572a9925bd6c..4e9f55ee3267 100644
>>>>> --- a/fs/resctrl/monitor.c
>>>>> +++ b/fs/resctrl/monitor.c
>>>>> @@ -1451,6 +1451,12 @@ ssize_t resctrl_mbm_assign_mode_write(struct kernfs_open_file *of, char *buf,
>>>>> }
>>>>>
>>>>> if (enable != resctrl_arch_mbm_cntr_assign_enabled(r)) {
>>>>> + if (IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED)) {
>>>>
>>>> Does it need to be a Kconfig entry or you can figure out programatically from
>>>> the architecture that that is the case and avoid yet another CONFIG_ knob?
>>>>
>>>> From reading this, I'm thinking
>>>>
>>>> if (IS ARM64) {
>>>>
>>>> should do or...?
>>>
>>> Yes, we don't necessarily need the Kconfig and we don't necessarily need this condition at all in
>>> resctrl_mbm_assign_mode_write(), we do need the existing one in resctrl_mbm_assign_mode_show() though.
>>
>> It is not obvious to me why the one in resctrl_mbm_assign_mode_show() is required if
>> a new arch helper could suffice in other parts
>
> I think a new arch helper could cover both.
>
>>
>>>
>>> The Kconfig was effectively added in:
>>>
>>> commit 3b497c3f4f04 ("fs/resctrl: Introduce the interface to display monitoring modes")
>>>
>>> and I was just filling in the missing piece. Most arch specific things in resctrl seem
>>> to be dealt with using resctrl_arch_* hooks. Would it be preferable to create a new one of these?
>>
>> It looks to me as though this patch fits in with the other series you posted at
>> https://lore.kernel.org/lkml/20260225201905.3568624-1-ben.horgan@arm.com/
>>
>> When looking at this patch together with the other series there may indeed be an arch
>> helper that can replace CONFIG_RESCTRL_ASSIGN_FIXED but as I mentioned in that series
>> the MPAM capabilities and strategies for resctrl to support them are not clear to me
>> at this time.
>
> If you like, I can drop this patch and tag a resctrl_arch_ hook based hook
> version on to that series when I respin. Do you prefer a new hook,
> resctrl_arch_mbm_cntr_assign_fixed(), or using/abusing the error return of
> resctrl_arch_mbm_assign_set()?
I am now focusing on understanding the MPAM requirements around assignable counters that
are being discussed as part of the other series you sent recently. Without that insight it
is difficult to have preference for an interface.
I do think it will be helpful to keep this work together in one series.
>>> It could be resctrl_arch_mbm_cntr_assign_fixed() although we seem to be getting too many
>>> of these too. Perhaps we could extend the meaning of another hook, resctrl_arch_mbm_assign_set() could
>>
>> Could you please elaborate which category of helper is getting to be too many? We can surely
>> explore improvements.
>
> Nothing major or anything that necessarily needs to change. Just that for each
> new feature we get a few new resctrl_arch_* and they all need to be updated in
> the MPAM driver even if the feature isn't used.
I see. These helpers evolved as part of the arch fs split. One option may be to have
an arch register callbacks instead that resctrl fs could test for existence and not require
every arch to have a stub.
Reinette
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-03-03 17:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-04 16:19 [PATCH v4] fs/resctrl: Add CONFIG_RESCTRL_ASSIGN_FIXED Kconfig entry Ben Horgan
2026-02-05 16:04 ` Reinette Chatre
2026-03-01 10:49 ` Borislav Petkov
2026-03-02 10:02 ` Ben Horgan
2026-03-02 23:32 ` Reinette Chatre
2026-03-03 14:24 ` Ben Horgan
2026-03-03 16:58 ` Reinette Chatre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox