mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Babu Moger <babu.moger@amd.com>
To: Reinette Chatre <reinette.chatre@intel.com>,
	Tony Luck <tony.luck@intel.com>, Ben Horgan <ben.horgan@arm.com>,
	James Morse <james.morse@arm.com>,
	Dave Martin <Dave.Martin@arm.com>,
	Drew Fustini <fustini@kernel.org>,
	Fenghua Yu <fenghuay@nvidia.com>, Chen Yu <yu.c.chen@intel.com>,
	Jinjie Ruan <ruanjinjie@huawei.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 v3] arm,x86,fs/resctrl: Generic schema description Proof of Concept
Date: Wed, 2 Dec 2026 09:31:04 -0600	[thread overview]
Message-ID: <b63d0868-68ad-4635-acdf-7a80adfc1346@amd.com> (raw)
In-Reply-To: <b06e1fc2-87f1-4004-8102-c8cc8928345c@intel.com>

Hi Reinette,

Thanks for the patches. Few comments below.

On 11/19/26 23:04, Reinette Chatre wrote:
> Hi Everybody,
> 
> I believe that discussions around resctrl's upcoming support for multiple
> controls are starting to settle. This RFC aims to capture all the remaining
> items in implementation as well as documentation. Please point out to me if
> there is anything I missed.
> 
> RFC v3 of this PoC can be found at:
> git://git.kernel.org/pub/scm/linux/kernel/git/reinette/linux.git branch resctrl/controls_rfc_v3
> 
> Please refer to the documentation patch for an overview of the planned interface
> changes as well as user space contracts/expectations:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/reinette/linux.git/commit/?h=resctrl/controls_rfc_v3&id=95ff9ff7430095cb7264946c944c750315db73d9
> 
> Remaining opens:
> ---------------
> - Ben: I do have a question about the formula used to determine the size of
>    a scalar cache control. Please see patch changelog of:
>    https://git.kernel.org/pub/scm/linux/kernel/git/reinette/linux.git/commit/?h=resctrl/controls_rfc_v3&id=8695aab0997d5aa60e104374fae9701f51156c18
> - MPAM only compile tested.
> - The same x86 "SAMPLE" code as RFC v2 to demonstrate emulated controls.
> - Add relationships between controls. For example, cannot set "MIN" control
>    value to be larger than "MAX. Unclear how to do this in resctrl fs when
>    considering that the relationship may span between emulated and backing
>    controls. This is potentially something that needs to be managed by architecture
>    and thus potentially without a consistent failure to user space.
> 
> Changes since RFC v2:
> --------------------
> RFC v2: https://lore.kernel.org/lkml/d258a32f-12d5-464d-abe9-4720fb3e44b3@intel.com/
>          git://git.kernel.org/pub/scm/linux/kernel/git/reinette/linux.git branch resctrl/controls_rfc_v2
> 
> User visible changes:
> - Make scope a property of the control again, now in addition to a separate
>    allocation scope of the resource. Expose the control scope via a new
>    per-control "scope" file (L2, L3, or NODE) that tells user space what a
>    domain ID in the schemata file represents. Needed to support AMD's GLBE
>    and CPU-less memory bandwidth allocation. (Ben and Babu)
> - Name controls according to the scheme agreed during RFC v2 discussions:
>    <resource>_<resource_scope><control_scope>_<control>, with the control
>    scope dropped when it matches the resource scope. MB and SMBA carry their
>    L3 scope only implicitly, so their new controls show it explicitly, for
>    example MB_L3_MAX, or MB_L3NODE for a default control at NODE scope.
>    https://lore.kernel.org/all/bccb1249-e722-451a-9c75-8aa846713045@intel.com/
> - Report "max" per domain in preparation for systems with resource
>    instances of different capacity. A bitmap's "max" no longer has a "0x"
>    prefix. (Drew and Tony)
> - Drop the "min_bits" file. The "min" file of a bitmap control now reports
>    the minimum number of consecutive bits.
> - Only offer, and only allow switching to, "native" control mode when the
>    resource has emulated controls. (Ben)
> - Only allow cache pseudo-locking via the default cache control.
> - Display the "size" of scalar cache controls. (Ben)
> - Stop reporting scalar control parsing errors as being about "MB". (Ben)
> - Document the control naming, the "scope" file, that control values may be
>    reset on a control mode switch, that legacy info files return no content
>    in "native" mode, and that non-legacy resources need not have a default
>    control.
> 
> Other changes:
> - Require a control and the controls it is emulated by to have the same
>    scope.
> - Require only legacy resources to start in legacy control mode.
> - Generate control schema suffix once during initialization.
> - Fix initialization of the list of emulating controls (Ben), clearing of
>    staged configurations of backing controls (Chenyu), and Haswell control
>    initialization (Chenyu).
> - Reword changelogs about CDP, allocation size and the bitmap control so
>    they no longer suggest resctrl will only ever support one cache control.
> - Fix checkpatch.pl issues, subject prefixes and changelog typos.
> 
> Series structure:
> - Rebase on:
>    - x86/cache branch of tip that is based on v7.4-rc1 with the queued
>      resctrl cleanups
>    - MPAM domain separation that was extracted from RFC v2 and submitted
>      separately:
>      https://lore.kernel.org/lkml/cover.1794283825.git.reinette.chatre@intel.com/
> - Squash four patches into the patches they support:
>    - "fs/resctrl: Provide control to cache allocation"
>    - "x86,fs/rectrl: Provide control when requesting arch to update a single
>      domain", which also keeps MPAM building at every patch in the series.
>    - "fs/resctrl: Expose bitmap properties via new files in schemata folder"
>    - "fs/resctrl: Include emulated controls when determining control field
>      width"
> - New patch from Ben: "fs/resctrl: Display size for scalar cache controls".
> - Move IO allocation control selection, and the helpers that display the
>    new control properties, earlier in the series.
> 
> Any feedback is appreciated.
> 

I compiled your code on my machine. The system booted successfully, and 
I was able to see the new control parameters and their values.

Here is the output.
.
./L3
./L3/bit_usage: 
0=SSSSSSSSSSSSSSSS;1=SSSSSSSSSSSSSSSS;2=SSSSSSSSSSSSSSSS;3=SSSSSSSSSSSSSSSS
./L3/cbm_mask: ffff
./L3/control_mode: [legacy]
./L3/io_alloc: disabled
cat: ./L3/io_alloc_cbm: Invalid argument
./L3/io_alloc_cbm:
./L3/min_cbm_bits: 0
./L3/num_closids: 16
./L3/schemata
./L3/schemata/L3
./L3/schemata/L3/max: 0=ffff;1=ffff;2=ffff;3=ffff
./L3/schemata/L3/min: 0
./L3/schemata/L3/scope: L3
./L3/schemata/L3/type: bitmap sparse
./L3/shareable_bits: 0
./L3/sparse_masks: 1
.

./last_cmd_status: ok
./MB
./MB/bandwidth_gran: 1
./MB/control_mode: [legacy]
./MB/delay_linear: 0
./MB/min_bandwidth: 0
./MB/num_closids: 16
./MB/schemata
./MB/schemata/MB
./MB/schemata/MB/max: 0=8192;1=8192;2=8192;3=8192
./MB/schemata/MB/min: 0
./MB/schemata/MB/resolution: 8
./MB/schemata/MB/scale: 1
./MB/schemata/MB/scope: L3
./MB/schemata/MB/tolerance: 0
./MB/schemata/MB/type: scalar
./MB/schemata/MB/unit: GBps

./SMBA
./SMBA/bandwidth_gran: 1
./SMBA/control_mode: [legacy]
./SMBA/delay_linear: 0
./SMBA/min_bandwidth: 0
./SMBA/num_closids: 16
./SMBA/schemata
./SMBA/schemata/SMBA
./SMBA/schemata/SMBA/max: 0=8192;1=8192;2=8192;3=8192
./SMBA/schemata/SMBA/min: 0
./SMBA/schemata/SMBA/resolution: 8
./SMBA/schemata/SMBA/scale: 1
./SMBA/schemata/SMBA/scope: L3
./SMBA/schemata/SMBA/tolerance: 0
./SMBA/schemata/SMBA/type: scalar
./SMBA/schemata/SMBA/unit: GBps

14 directories, 49 files

I noticed that only the max values are exposed on a per-domain basis: 
but min is displayed only once.

./SMBA/schemata/SMBA
./SMBA/schemata/SMBA/max: 0=8192;1=8192;2=8192;3=8192
./SMBA/schemata/SMBA/min: 0

Is that intentional?

Also, I was expecting the x86 msr_update implementation to be converted 
into a generic handler, as we discussed earlier:

https://lore.kernel.org/lkml/6e440b7f-66db-4c4e-a6ac-2cb418739bad@amd.com/

Do you have any plans to address that in this series?

I haven't ported my GLBE code on top of this series yet. I'll let you 
know if I encounter any issues, but from what I've seen so far, the 
porting effort looks fairly straightforward looking at the sample code.

Thanks,

Babu

      parent reply	other threads:[~2026-12-02 15:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  5:04 Reinette Chatre
2026-11-20 19:48 ` Fenghua Yu
2026-11-20 20:26   ` Reinette Chatre
2026-11-23  3:16 ` Chen Yu
2026-11-24  4:26   ` Reinette Chatre
2026-11-25  5:10     ` Chen Yu
2026-11-25 23:15       ` Reinette Chatre
2026-12-01 12:16         ` Chen Yu
2026-11-30 12:37 ` Ben Horgan
2026-12-02 15:31 ` Babu Moger [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=b63d0868-68ad-4635-acdf-7a80adfc1346@amd.com \
    --to=babu.moger@amd.com \
    --cc=Dave.Martin@arm.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=reinette.chatre@intel.com \
    --cc=ruanjinjie@huawei.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®