mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chen, Yu C" <yu.c.chen@intel.com>
To: Reinette Chatre <reinette.chatre@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>,
	Ben Horgan <ben.horgan@arm.com>, Tony Luck <tony.luck@intel.com>,
	Dave Martin <Dave.Martin@arm.com>,
	James Morse <james.morse@arm.com>,
	Drew Fustini <fustini@kernel.org>,
	Babu Moger <babu.moger@amd.com>, Fenghua Yu <fenghuay@nvidia.com>
Subject: Re: [RFC] mpam,x86,fs/resctrl: Generic schema description Proof of Concept
Date: Thu, 11 Jun 2026 01:57:03 +0800	[thread overview]
Message-ID: <a04cdb13-5a25-47c1-810c-15289e0d9cc5@intel.com> (raw)
In-Reply-To: <f9508f8f-a3c4-46b4-b57a-9d25660cc7e4@intel.com>

Hi Reinette,

On 6/11/2026 12:13 AM, Reinette Chatre wrote:
> Hi Chenyu,
> 

[ ... ]

>>> Regarding the region-aware RDT case, I wonder if we actually need to emulate the
>>> legacy MB control using MB_MAX. First, when we refer to the "legacy" for region-aware
>>> RDT, I suppose it corresponds to "MSR access" plus "percentage-based control".
>>>
>>> case 1:
>>> If the platform does not support region-aware RDT (no ERDT table is detected),
>>> the MB is naturally the "legacy" MB, and the info directory would look like:
>>>
>>> info
>>> └── MB
>>>           └── resource_schemata
>>>                   └── MB
>>>
>>> case 2:If the platform supports region-aware RDT (i.e., ERDT parsing succeeds),
>>> then the structure looks like below:
>>>
>>> info
>>> └── MB
>>>           └── resource_schema
>>>                   └── MB                  <=== legacy
>>>                   └── MB_REGION0_OPT
>>>                   └── MB_REGION1_OPT
>>>                   └── MB_REGION0_MIN
>>>                   └── MB_REGION1_MIX
>>>                   └── MB_REGION0_MAX
>>>                   └── MB_REGION1_MAX
>>>
>>
>> This may be slightly off-topic from MAX emulation, but I have another
>> thought regarding multi-controllers for rdt_resource:
>> As we know, with N regions, an MB resource will have a total of N × 3
>> controllers. Given that the current PoC iterates through every controller
>> within the resource in resctrl_resource_ctrl_get(), could this increase
>> lookup latency?
> 
> resctrl_resource_ctrl_get() is only called when the user writes to the
> schemata file and since user can modify any of the enabled controls with
> a write to the schemata file it is necessary to iterate through all controls
> to find a match.
> 

Yes, I was thinking if we can speed up this write by not iterating the 
control
list.

>>
>> I studied the cgroup code and found that each controller for a cgroup
>> resource uses a dedicated cftype. For example:
>> static struct cftype memory_files[] = {
>>      { .name = "min",  .write = memory_min_write,  .seq_show = memory_min_show },
>>      { .name = "max",  .write = memory_max_write,  .seq_show = memory_max_show },
>>      ...
>> };
> 
> The PoC currently has "static struct rftype ctrl_files[] " that associates an
> rftype with every property of a control which enables all user space interactions
> with the individual controls to be direct.
> 

Yes we have dedicated rftype for the read-only info/properties.

>>
>> The min/max memory controllers can be accessed in O(1) time using:
>> of_cft(of) -> kn->priv, and cft->write(of, buf, ...)
>>
>> rftype is resctrl's equivalent of cftype, and schemata is currently implemented
>> as a single rftype. Would it make sense to define a separate rftype for each
>> resctrl controller(or maybe in the future consider that this is not in a critical path)
> 
> Your suggestion is not clear to me. The schemata file is associated with a control group,
> a resource group that has multiple allocations each backed by a different controller.
> 
> I do not think I fully understand your suggestion so would appreciate if you could
> provide more detail.
> 

Sorry, I did not describe this precisely. My original thought is that 
when writing
schemata, we need to locate the control by iterating through the control 
list:
rdtgroup_schemata_write
   for_each_resource_ctrl(ctrl, r)
     if (!strncmp())
       return ctrl;
   parse_line("0=80;1=60", ctrl)

I just wonder if we can skip iterating the control list, by
giving each control a dedicated rftype(and rftype needs to introduce
a pointer struct resctrl_ctrl *ctrl)
rdtgroup_ctrl_schemata_write()
   rft = of->kn->priv
   parse_line("0=80;1=60", rft->ctrl)

thanks,
Chenyu

  reply	other threads:[~2026-06-10 17:57 UTC|newest]

Thread overview: 84+ 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 [this message]
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-17 16:02                     ` Chen, Yu C
2026-07-17 16:55                       ` 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=a04cdb13-5a25-47c1-810c-15289e0d9cc5@intel.com \
    --to=yu.c.chen@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=reinette.chatre@intel.com \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox