From: Reinette Chatre <reinette.chatre@intel.com>
To: "Luck, Tony" <tony.luck@intel.com>,
"Yu, Fenghua" <fenghua.yu@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Shaopeng Tan <tan.shaopeng@fujitsu.com>,
Jamie Iles <quic_jiles@quicinc.com>,
James Morse <james.morse@arm.com>,
"Babu Moger" <babu.moger@amd.com>
Cc: "x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 0/7] Add driver registration i/f to resctrl
Date: Fri, 12 May 2023 09:57:00 -0700 [thread overview]
Message-ID: <b35c1b06-4236-15dc-6aed-ece8a0331c8c@intel.com> (raw)
In-Reply-To: <SJ1PR11MB6083031582F2A61A7D24ABAFFC749@SJ1PR11MB6083.namprd11.prod.outlook.com>
Hi Tony,
On 5/11/2023 1:35 PM, Luck, Tony wrote:
> Reinette,
>
> You asked for examples of resources that don't fit well into the
> existing schemata model.
Primarily about me trying to understand what about the existing schemata
model makes these new features hard to support. My first confusion is
that it is not clear to me what you mean with "schemata
model". I think there are two parts to this: the schemata model as
the user interface and the schemata model as implemented within
resctrl.
It is not clear in your motivation whether you are talking about the
former or the latter and thus dug through the patches to figure this
out. At first it seemed as though the driver aims for a totally
different configuration mechanism with the support for driver specific
writable files in every group ... but then then the driver pivots and
hooks into schemata files so it then seems that the driver mechanism does
aim to maintain the schemata model as user interface (perhaps with
additional configuration files to give more meaning to the values
written to the schemata file).
So, it seems to me that the concern is not with the user interface, but
how the schemata parsing is done in resctrl. I just seem to keep guessing
here so I would appreciate more insight.
> Here's the details behind one of those cases.
>
> Existing resources have a single value per domain (e.g. a cache-way
> bitmask, or a memory bandwidth percentage or target). One of my new
> resources has several parameters. At first glance this might be
> solved by just listing a comma separated list of these parameters
> for each domain. So the schemata entry for feature XYZ that has two
> domains might look like this:
> XYZ:0=param1,param2,param3;1=param1,param2,param3
>
> But this feature has a second problem. The hardware supports a very
> limited set of variations. This could be handled by reporting
> num_closid for this resource to that low number. But then resctrl
> core code would limit all resources to that value. Instead the h/w
> allows programming a mapping feature from closid numbers to resource
> instances (as the saying goes "any computer science problem can be
> solved with one extra level of indirection").
>
> So if the driver named these instances: A, B, C, D. Then a schemata
> file might look like:
>
> XYZ:0=B;1=C
>
> meaning that the driver will set up so CLOSID for this resctrl
> resource is mapped to instance "B" on domain 0 and to instance "C" on
> domain 1
Apologies but it is still not clear to me how this cannot be handled
in resctrl. For example, consider this hypothetical snippet that uses
a unique callback to parse a resource's schemata entry (similar to the
s->update() callback you introduce, but not have it be optional):
struct resctrl_schema *s;
list_for_each_entry(s, &resctrl_schema_all, list) {
if (!strcmp(resname, s->name) && rdtgrp->closid < s->num_closid)
return s->parse_line(tok, s, rdtgrp);
}
rdt_last_cmd_printf("Unknown or unsupported resource name '%s'\n", resname);
> The driver provides a way to set param1, param2, param3 for each of
> the A, B, C, D instances.
Seems like these could be some new RFTYPE_RES_XYZ files?
On the model specific motivation topic: If the goal of the driver
interface is to support model specific changes to resctrl there is a
publicly available use case for consideration:
https://lore.kernel.org/lkml/20230421141723.2405942-1-peternewman@google.com/
It is not obvious to me how that model specific problem could be solved
with this driver interface. Your insight here would be appreciated but it
seems to me that we will have to keep accommodating model specific code
in resctrl.
Reinette
next prev parent reply other threads:[~2023-05-12 16:57 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 22:06 [RFC PATCH 0/7] Add driver registration i/f to resctrl Tony Luck
2023-04-20 22:06 ` [RFC PATCH 1/7] x86/resctrl: Add register/unregister functions for driver to hook into resctrl Tony Luck
2023-05-05 23:17 ` Reinette Chatre
2023-04-20 22:06 ` [RFC PATCH 2/7] x86/resctrl: Add an interface to add/remove a new info/directory Tony Luck
2023-04-20 22:06 ` [RFC PATCH 3/7] x86/resctrl: Add driver callback when directories are removed Tony Luck
2023-05-05 23:19 ` Reinette Chatre
2023-04-20 22:06 ` [RFC PATCH 4/7] x86/resctrl: Add capability to driver registration to create control files Tony Luck
2023-05-05 23:20 ` Reinette Chatre
2023-04-20 22:06 ` [RFC PATCH 5/7] x86/resctrl: Enhance driver registration to hook into schemata files Tony Luck
2023-05-05 23:20 ` Reinette Chatre
2023-04-20 22:06 ` [RFC PATCH 6/7] x86/resctrl: Allow a device to override an existing schemata entry Tony Luck
2023-05-05 23:20 ` Reinette Chatre
2023-04-20 22:06 ` [RFC PATCH 7/7] x86/resctrl: Example resctrl driver Tony Luck
2023-05-05 23:17 ` [RFC PATCH 0/7] Add driver registration i/f to resctrl Reinette Chatre
2023-05-08 18:32 ` Luck, Tony
2023-05-09 21:34 ` Reinette Chatre
2023-05-09 23:35 ` Luck, Tony
2023-05-10 0:07 ` Reinette Chatre
2023-05-10 0:52 ` Luck, Tony
2023-05-11 20:35 ` Luck, Tony
2023-05-12 16:57 ` Reinette Chatre [this message]
2023-05-12 20:35 ` Luck, Tony
2023-05-12 21:08 ` Reinette Chatre
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=b35c1b06-4236-15dc-6aed-ece8a0331c8c@intel.com \
--to=reinette.chatre@intel.com \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=james.morse@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=quic_jiles@quicinc.com \
--cc=tan.shaopeng@fujitsu.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