mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Horgan <ben.horgan@arm.com>
To: Reinette Chatre <reinette.chatre@intel.com>,
	Tony Luck <tony.luck@intel.com>,
	James Morse <james.morse@arm.com>,
	Dave Martin <Dave.Martin@arm.com>,
	Babu Moger <babu.moger@amd.com>,
	Drew Fustini <fustini@kernel.org>,
	Fenghua Yu <fenghuay@nvidia.com>, Chen Yu <yu.c.chen@intel.com>
Cc: Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Peter Newman <peternewman@google.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] mpam,x86,fs/resctrl: Generic schema description Proof of Concept
Date: Fri, 5 Jun 2026 17:37:33 +0100	[thread overview]
Message-ID: <3ef279c9-c4b3-48cb-8235-da8a871b54f9@arm.com> (raw)
In-Reply-To: <7f2d0cc3-266c-4fa3-a9ba-7352325c76d1@intel.com>

Hi Reinette,

On 6/5/26 16:39, Reinette Chatre wrote:
> Hi Ben,
> 
> On 6/5/26 7:53 AM, Ben Horgan wrote:
>> On 6/4/26 18:43, Reinette Chatre wrote:
>>> On 6/3/26 8:15 AM, Ben Horgan wrote:
>>>> On 5/29/26 19:06, Reinette Chatre wrote:
> 
> ...
>  
>>>
>>>> I plumbed in support for the MB_MIN resource schema which also works under light
>>>> testing. The only fs resctrl code change I needed was:
>>>>
>>>> --- a/include/linux/resctrl.h
>>>> +++ b/include/linux/resctrl.h
>>>> @@ -483,6 +483,9 @@ static inline u32 resctrl_get_default_ctrlval(struct
>>>> resctrl_ctrl *ctrl)
>>>>         case RESCTRL_CTRL_BITMAP:
>>>>                 return BIT_MASK(ctrl->cache.cbm_len) - 1;
>>>>         case RESCTRL_CTRL_SCALAR:
>>>> +               if (ctrl->name == RESCTRL_CTRL_NAME_MIN)
>>>> +                       return ctrl->membw.min_bw;
>>>> +
>>>>                 return ctrl->membw.max_bw;
>>>>         }
>>>>
>>>>
>>>> At least on MPAM systems, we use a default of 0 for minimum bandwidth controls
>>>> as the maximum bandwidth controls only take effect if their value is higher than
>>>> the minimum bandwidth value. I have specialised this on the ctrl->name which
>>>> breaks your ctrl->type based classification but that's fixable by just adding a
>>>> default field to membw.
>>>
>>> This I am not sure about. In my understanding a typical "default" value means
>>> "no throttling" and, at least on Intel, this default hardware state has been
>>> summarized as "min" == "max" == "optimal".
>>
>> Ok, this sounds odd to me but that is probably because I don't know what Intel
>> systems do. On MPAM systems a MIN control is a boost rather than a throttling
>> control. Although, you can always think of that as throttling the traffic with
>> the other PARTIDs.
>>
>>>
>>> Are you saying that on MPAM systems if "min" == "max" then max bandwidth controls
>>> do not take effect? Could you please elaborate what happens if "min" == "max"?
>>
>> Table 5-4 from section 5.2.8 of the IHI0099B.b shows the interaction between the
>> min and maximum controls.
>>
>> If used bandwidth is   The preference is  Description
>> Below the minimum      High               Only high requests compete with this
>>                                           request.
>> Above the minimum:
>>   Below the maximum    Medium             High requests are serviced first then
>>
>>                                           this request competes with other
>>                                           medium requests.
>>
>>   Above the maximum,   Low                Requests are not serviced if any high
>>   when HARDLIM is 0                       or  medium requests are available.
>>
>>   Above the maximum,   None               Requests are not serviced
>>   when HARDLIM is 1
>>
>> So if we keep the minimum and the maximum controls values always the same then
>> all traffic will be given "high" preference until the target bandwidth is
>> reached. For some MPAM systems it is recommended to set the minimum value as 5%
>> less than the maximum value to get a reliable target bandwidth. As 5% seems
>> implementation specific and some systems don't have min controls it seemed
>> better to just match the MB control with a maximum bandwidth control and let the
>> user have freedom to choose the minimum bandwidth control when MB_MIN support is
>> added.
>>
>> If a default for the minimum of the maximum possible bandwidth is used (100%)
>> then any change of the maximum won't have any effect as it's always less than
>> minimum (if that's unchanged) and so all traffic is high preference. I now see
>> from your reply below that you are planning on not allowing this kind of
>> configuration.
>>
>> If the minimum always tracks the maximum then we lose the distinction between
>> medium and high preference traffic and so to reserve some high preference
>> bandwidth for one control group we'd have to change the configuration in the
>> other controls groups so that they're bandwidth preference is medium (minimum
>> value at 0).
> 
> I do not think we are talking about the same thing here. I am *not* saying
> that minimum and maximum controls should always be the same.
> 
> The discussion is about a proposed change to resctrl_get_default_ctrlval(). resctrl
> uses this function in two places:
>  - When creating a new resource group: 
>    The intention here is that when user space creates a new resource group it should
>    be created with maximum allocations possible. For MBA this means "unthrottled".

I would contend that for minimum controls that a policy of 'maximum allocation
possible' isn't a useful default. I try and explain a bit more below.

>    After creating the resource group user space can adjust allocations to match
>    workload requirements.
>  - When unmounting the resctrl fs.
>    The intention here is that all controls are set to unthrottled to stop any possible
>    impact to system when user space stops using resctrl.
> 
> resctrl_get_default_ctrlval() is thus intended to support an unthrottled baseline from
> where user space can make configuration changes as supported by hardware and required
> by workloads.

The baseline that I see makes most sense for a minimum control is to have the
default as 0. This just means that there is no "guaranteed"/high preference
bandwidth reserved for the control group. I would say this still unthrottled but
just not giving a boost. With this default the user can use MB (backed by max
bandwidth) without having to know about MB_MIN (keeping it constant). If the
default is 100% for min bandwidth then the user needs to know to set MB_MIN to
be able to use MB. Having a default of 100% for max bandwidth, correspondingly
means a user can change MB_MIN and see guaranteed bandwidth effects without
having to know about MB/MB_MAX.

Does this make sense?

> 
> I see that the MPAM driver internally uses resctrl_get_default_ctrlval() in a couple
> of places and I am not considering this usage here. If internally MPAM has other
> usages for this function where it does not mean "unthrottled" then perhaps
> it would be better to create a new function that matches the usage?

I don't think the internal usage makes a difference here.

One process thing I was wondering about so that I know how to structure my
patches. In the series you have a few patches which touch all architectures;
these have the prefix mpam,x86,fs/resctrl. Is this how you would like cross
architectures patches to look like or is it just for convenience in the rfc and
a patch per-architecture is preferable?

Thanks,

Ben


  reply	other threads:[~2026-06-05 16:37 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29 18:06 Reinette Chatre
2026-06-02 20:23 ` Babu Moger
2026-06-02 22:56   ` Reinette Chatre
2026-06-03  1:14     ` Moger, Babu
2026-06-03  3:55       ` Reinette Chatre
2026-06-03 14:40         ` Babu Moger
2026-06-02 23:32 ` Chen, Yu C
2026-06-03  3:45   ` Reinette Chatre
2026-06-03 11:53     ` Chen, Yu C
2026-06-04 16:37       ` Reinette Chatre
2026-06-05 15:43         ` Chen, Yu C
2026-06-05 16:20           ` Reinette Chatre
2026-06-03 15:15 ` Ben Horgan
2026-06-03 19:34   ` Drew Fustini
2026-06-04 11:24     ` Ben Horgan
2026-06-04 17:38       ` Drew Fustini
2026-06-12  1:30         ` Shaopeng Tan (Fujitsu)
2026-06-17 15:29           ` Reinette Chatre
2026-06-19  1:42             ` Shaopeng Tan (Fujitsu)
2026-06-22 16:10               ` Reinette Chatre
2026-06-23  5:04                 ` Shaopeng Tan (Fujitsu)
2026-06-04 21:05     ` Reinette Chatre
2026-06-05 19:35       ` Drew Fustini
2026-06-06  5:10         ` Drew Fustini
2026-06-06  5:23           ` Drew Fustini
2026-06-04 17:43   ` Reinette Chatre
2026-06-05 14:53     ` Ben Horgan
2026-06-05 15:39       ` Reinette Chatre
2026-06-05 16:37         ` Ben Horgan [this message]
2026-06-08 16:16           ` Reinette Chatre
2026-06-09 10:10             ` Ben Horgan
2026-06-09 15:28               ` Reinette Chatre
2026-06-09 16:37                 ` Ben Horgan
2026-06-09 17:41                   ` Reinette Chatre
2026-06-10  7:09                     ` Chen, Yu C
2026-06-10 14:27                       ` Chen, Yu C
2026-06-10 16:13                         ` Reinette Chatre
2026-06-10 17:57                           ` Chen, Yu C
2026-06-10 18:10                             ` Reinette Chatre
2026-06-10 15:59                       ` Reinette Chatre
2026-06-10 18:05                         ` Chen, Yu C
2026-06-11  3:26                         ` Chen, Yu C
2026-06-11 15:45                           ` Reinette Chatre
2026-06-26 15:46                             ` Chen, Yu C
2026-07-02 14:27                               ` Ben Horgan
2026-07-03  9:01                                 ` Chen, Yu C
2026-07-14 21:37                               ` Reinette Chatre
2026-07-15  2:49                                 ` Chen, Yu C
2026-06-10  4:31                 ` Drew Fustini
2026-06-10 15:14                   ` Reinette Chatre
2026-06-03 18:46 ` Luck, Tony
2026-06-04 10:02   ` Ben Horgan
2026-06-04 21:42   ` Reinette Chatre
2026-07-08 12:56     ` Chen, Yu C
2026-07-14 21:39       ` Reinette Chatre
2026-06-03 22:14 ` Drew Fustini
2026-06-04 21:47   ` Reinette Chatre
2026-06-05 19:48     ` Drew Fustini
2026-06-15 21:05 ` Moger, Babu
2026-06-17 17:18   ` Reinette Chatre
2026-06-17 20:29     ` Babu Moger
2026-06-24 19:08 ` Fenghua Yu
2026-06-24 22:22   ` Reinette Chatre
2026-06-25  1:26     ` Fenghua Yu
2026-06-25 15:43       ` Reinette Chatre
2026-07-10 20:59         ` Fenghua Yu
2026-07-14 22:06           ` Reinette Chatre
2026-07-15  8:34             ` Ben Horgan
2026-07-15 15:41               ` Reinette Chatre
2026-07-16 14:59                 ` Ben Horgan
2026-07-16 16:02                   ` Luck, Tony
2026-07-16 16:22                     ` Ben Horgan
2026-07-16 17:50                       ` Reinette Chatre
2026-07-17 10:27                         ` Ben Horgan
2026-07-16 16:04                   ` Reinette Chatre
2026-07-16 16:44                     ` Ben Horgan
2026-07-16 17:07                       ` Reinette Chatre
2026-07-17 12:20                         ` Ben Horgan
2026-07-17 16:00                           ` Reinette Chatre
2026-07-20 13:30                             ` Ben Horgan
2026-07-20 22:54                               ` Reinette Chatre
2026-07-21 13:23                                 ` Ben Horgan
2026-07-21 17:30                                   ` Reinette Chatre
2026-07-21 20:02                                     ` Babu Moger
2026-07-22 10:47                                       ` Ben Horgan
2026-07-22 17:02                                         ` Babu Moger
2026-08-04  9:11                                           ` Ben Horgan
2026-08-04 14:09                                             ` Babu Moger
2026-08-04 15:11                                               ` Ben Horgan
2026-08-04 19:51                                                 ` Babu Moger
2026-08-05  6:06                                                 ` Reinette Chatre
2026-08-06  9:24                                                   ` Ben Horgan
2026-08-07 22:53                                                     ` Reinette Chatre
2026-07-22 10:03                                     ` Ben Horgan
2026-07-22 16:32                                       ` Reinette Chatre
2026-07-23  7:58                                         ` Ben Horgan
2026-07-23 15:52                                           ` Reinette Chatre
2026-07-23 22:08                                   ` Fenghua Yu
2026-07-27  9:13                                     ` Ben Horgan
2026-07-17 16:02                     ` Chen, Yu C
2026-07-17 16:55                       ` Reinette Chatre
2026-07-23  0:17             ` Fenghua Yu
2026-07-23 16:18               ` Reinette Chatre
2026-07-23 22:27                 ` Fenghua Yu
2026-07-23 23:31                   ` Reinette Chatre
2026-07-02 13:37       ` Ben Horgan
2026-07-02 15:16         ` Fenghua Yu
2026-07-03 13:42           ` 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=3ef279c9-c4b3-48cb-8235-da8a871b54f9@arm.com \
    --to=ben.horgan@arm.com \
    --cc=Dave.Martin@arm.com \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=fenghuay@nvidia.com \
    --cc=fustini@kernel.org \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peternewman@google.com \
    --cc=reinette.chatre@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.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

all inboxes | Powered by JetHome®