mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Ben Horgan <ben.horgan@arm.com>, Fenghua Yu <fenghuay@nvidia.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>, 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: Wed, 22 Jul 2026 09:32:04 -0700	[thread overview]
Message-ID: <18d0360b-5567-4c66-b4f0-9d6f25d983ec@intel.com> (raw)
In-Reply-To: <c508b580-f0f8-4bdf-8323-008d80bb7578@arm.com>

Hi Ben,

On 7/22/26 3:03 AM, Ben Horgan wrote:
> On 7/21/26 18:30, Reinette Chatre wrote:
>> On 7/21/26 6:23 AM, Ben Horgan wrote:
>>> On 7/20/26 23:54, Reinette Chatre wrote:

...
>>> I don't think we should introduce more percent based controls and for new controls we can introduce
>>> a new format to describe them. Perhaps just the positive integer with a resolution supplied in info/
>>
>> No, we should not introduce more percentage based controls per se. With the new schema format a
>> percentage based control is just a variant of a proportional scalar control.
>>
>>> as discussed previously. Although, I have been pondering on whether we can do a bit better.
>>>
>>> We could use hexadecimal point based format for controls which are a proportion of a resource and
>>> have a resolution which is a power of 2. The advantage of this is that the meaning of the value is
>>> independent of the granularity of the control (number of parts).
>>>
>>> 0 is represented as 0x0
>>> 1 as                0x1
>>> 1/2 as              0x0.8
>>> 7/256 as            0x0.07
>>> 1/2**28             0x0.00000001
>>> etc
>>>
>>> This maps well to the MPAM fixed-point fraction point format without having the weirdness of having
>>> values forced to 1 or 0 not being really 0. These MPAM h/w oddities can be hidden just by using the
>>> mbw_min mbw_max of a control. In MPAM this could be used in CMIN, CMAX, MB_MAX, MB_MIN and I would
>>> hope this would be useful for other architectures too. I am preparing some RFC patches on top of
>>> your PoC for consideration of this idea and to explore some of the proposals discussed relating to
>>> generic schemata and how they land in practice from the MPAM side.
>>
>> I'm going to stand with Dave Martin [1] on this point with a preference to avoid floating point in
>> resctrl input and output.
> 
> Ok, but I'm not suggesting floating point. Dave's two objections to floating point were that it's
> not exact and that it's hard to parse. For the first it is exact as it is using base 16 and for the
> parsing it's essentially parsing a prefix, '0x0.', and then a hexadecimal value and shifting for
> resolution. 0 and 1 will need to be considered as special cases. What I did wonder if it was too
> weird a format for userspace. Anyhow, no point flogging a dead horse, let's just go with using a
> number in a proportional schema along with the resolution as Dave summarized in [1]
> 
> [1] https://lore.kernel.org/lkml/aPtfMFfLV1l%2FRB0L@e133380.arm.com/

ok. I do like how the scalar control from that proposal accommodates a variety of proportional and
absolute hardware controls without forcing/requiring hardware controls to be a particular shape.

> 
>> Could you please elaborate where values are forced to 1 or 0? The new schema format was intentionally
>> created to *avoid* rounding errors (and parsing complexity).
> 
> This a property of the MPAM fixed-point fraction point format in the hardware. It would need to be
> hidden whatever resctrl schema format is used, percentage, scalar, fraction ... etc.

Just a clarification, all three of the examples you mention (percentage, scalar, fraction) are currently
expected to be supported by the single "scalar" control.

(see later for comment on "need to be hidden")

> For an MPAM MBW MAX control with a width of 4 bit the range of values in 0-0xF. In this set up the
> resolution is 16 but there are only 15 possible values. For MBW MAX a 0 in hardware the minimum
> value which becomes 1/16, ~6%.
> See mpam_resctrl.c:mbw_max_to_percent() for how this is currently dealt with.
> 
> For an MPAM MBW MIN control we shift the other way and so 0 is 0 but (with 4 bits) 0xF is 15/16 ~94%.
> When the input resolution is a power of 2 these conversions between h/w value and schemata value can
> be slightly simplified but there is still some ugly offset of 1.
> 
> (The spec is a little less precise than this and uses weasel words like "Arm recommends..." but this
> seems to be the sensible interpretation. See ARM IHI0099B.c "MPAM system component specification",
> Section 9.3.)

Thank you for the clarification. Sounds related to the weasel words in
https://lore.kernel.org/lkml/20260709093111.367851-4-ben.horgan@arm.com/ that took us a while to settle on.

You mention above that this would need to be hidden but from what I understand this is accommodated by
the "tolerance" property of the "scalar" control?

Per https://lore.kernel.org/lkml/aPtfMFfLV1l%2FRB0L@e133380.arm.com/:

	Note on the "tolerance" parameter:

	This is a new addition.  On the MPAM side, the hardware has a choice
	about how to interpret the control value in some edge-case situations.
	We may not reasonably be able to probe for this, so it may be useful
	to warn software that there is an uncertainty margin.


>> [1] https://lore.kernel.org/lkml/aNFliMZTTUiXyZzd@e133380.arm.com/
>>
>>>> I also understand MPAM to support more memory bandwidth controls ("MIN", "HARDMAX"/"HARDLIM", etc.).
>>>> Do you envision them to exist within info/MB/resource_schemata/<control> as well as within
>>>> info/MB_NODE/resource_schemata/<control>?
>>>
>>> Yes, at least for MIN, see the info/ tree above. For HARDLIM, perhaps, but HARDLIM has the added
>>> complications that it is a property of the MBW_MAX control and that it may be configurable for each
>>> PARTID or a fixed property of the h/w. When HARDLIM is configurable the control name could be of the
>>> form <resource_type>_<scope>_<control>_<control_param> where <control_param> is HARDLIM and the full
>>> name for the HARDLIM configuration on the MB_NODE resource is MB_NODE_MAX_HARDLIM. There can also be
>>> an info/<resource>/resource_schemata/<control>/lim file which has values, soft, hard, configurable.
>>
>> ack. HARDLIM sounds like it would be a new control type. Perhaps a "boolean" type for which new control
>> files need to be decided on? Sounds like you are headed in this direction and already have one control file
>> in mind for this new type.
>>
>> With this in mind the control could be built on top of what is being developed at the moment, possibly
>> be presented to user space following Dave Martin's suggestion in
>> https://lore.kernel.org/lkml/aO0Oazuxt54hQFbx@e133380.arm.com/:
>>
>>  | MB_HARDMAX: 0=0, 1=1, 2=1, 3=0 [...]
>>
>>  or
>>
>>  | MB_HARDMAX: 0=off, 1=on, 2=on, 3=off [...]
> 
> I'm happy with either of these format but have a slight preference for the second as on/off more
> clearly indicates this is a boolean with only two choices.

So far I am only aware of MPAM needing a boolean control which hints to me that MPAM can set direction here.

Reinette

  reply	other threads:[~2026-07-22 16:32 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
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 [this message]
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=18d0360b-5567-4c66-b4f0-9d6f25d983ec@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=Dave.Martin@arm.com \
    --cc=babu.moger@amd.com \
    --cc=ben.horgan@arm.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=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®