From: James Morse <james.morse@arm.com>
To: Reinette Chatre <reinette.chatre@intel.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Cc: Fenghua Yu <fenghua.yu@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
H Peter Anvin <hpa@zytor.com>, Babu Moger <Babu.Moger@amd.com>,
shameerali.kolothum.thodi@huawei.com,
D Scott Phillips OS <scott@os.amperecomputing.com>,
carl@os.amperecomputing.com, lcherian@marvell.com,
bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com,
baolin.wang@linux.alibaba.com,
Jamie Iles <quic_jiles@quicinc.com>,
Xin Hao <xhao@linux.alibaba.com>,
peternewman@google.com, dfustini@baylibre.com,
amitsinght@marvell.com, David Hildenbrand <david@redhat.com>,
Rex Nie <rex.nie@jaguarmicro.com>,
Dave Martin <dave.martin@arm.com>
Subject: Re: [PATCH v3 03/38] x86/resctrl: Add a schema format enum and use this for fflags
Date: Mon, 1 Jul 2024 19:17:37 +0100 [thread overview]
Message-ID: <d8e30c4f-04ef-4ed0-9d06-7f735c1c5e90@arm.com> (raw)
In-Reply-To: <62581526-2dfa-44a5-a0bb-8582932b9943@intel.com>
Hi Reinette,
On 28/06/2024 17:43, Reinette Chatre wrote:
> On 6/14/24 7:59 AM, James Morse wrote:
>> resctrl has three types of control, these emerge from the way the
>> architecture initialises a number of properties in struct rdt_resource.
>>
>> A group of these properties need to be set the same on all architectures,
>> it would be better to specify the format the schema entry should use, and
>> allow resctrl to generate all the other properties it needs. This avoids
>> architectures having divergant behaviour here.
>
> divergant -> divergent ?
>
>>
>> Add a schema format enum, and as a first use, replace the fflags member
>> of struct rdt_resource.
>>
>> The MBA schema has a different format between AMD and Intel systems.
>> The schema_fmt property is changed by __rdt_get_mem_config_amd() to
>> enable the MBPS format.
>> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> index e3edc41882dc..b12307d465bc 100644
>> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> @@ -2162,6 +2162,19 @@ static int rdtgroup_mkdir_info_resdir(void *priv, char *name,
>> return ret;
>> }
>> +static u32 fflags_from_resource(struct rdt_resource *r)
>> +{
>> + switch (r->schema_fmt) {
>> + case RESCTRL_SCHEMA_BITMAP:
>> + return RFTYPE_RES_CACHE;
>> + case RESCTRL_SCHEMA_PERCENTAGE:
>> + case RESCTRL_SCHEMA_MBPS:
>> + return RFTYPE_RES_MB;
>> + }
>> +
>> + return WARN_ON_ONCE(1);
>> +}
>> +
>
> The fflags returned specifies which files will be associated with the resource
> in the "info" directory. Basing this on a property of the schema does not look
> right to me. I understand that many of the info files relate to, for example,
> information related to the bitmap used by the cache,
Do we agree that some of them are?
One reason for doing this is it decouples the parsing and management of bitmaps from "this
is the L3 cache", which will make it much easier to support bitmaps on some other kind of
resource.
Ultimately I'd like to expose these to user-space, so that user-space can work out how to
configure resources it doesn't recognise. Today '100' could be a percentage, a bitmap, or
a value in MB/s. Today some knowledge of the control type is needed to work this out.
> but that is not the same for
> info files related to the MBA resource (all info files related to MBA resource
> are not about the schema property format).
Hmmm, because the files min_bandwidth and bandwidth_gran both have bandwidth in their name?
I agree 'delay_linear' and 'thread_throttle_mode' are a bit strange.
> I do not think the type of values of a schema should dictate which files
> appear in the info directory.
Longer term I think this will be a problem. We probably only have 3 types of control:
percentage, bitmap and MB/s... but if each resource on each architecture adds files here
the list will quickly grow. User-space won't be able to work out how to configure a
resource type it hadn't seen before.
This may not be the time - but I think eventually resctrl shouldn't have to care about
what resources the architecture is presenting.
For these files, we may need to duplicate 'min_bandwidth' as 'min_percentage'. MBA would
have both, but any new controls using percentage wouldn't expose them.
> Doesn't MPAM support percentage for cache resources
> and bitmaps for memory resources?
It can have fixed-point-fractions and bitmaps for both caches and memory. Unfortunately
everything in MPAM is optional - the driver converts whatever it finds for memory
bandwidth to a percentage as that is what resctrl and user-space expect.
I can't do the same for cache controls as bitmaps implicitly isolate portions, something
that can't be done with the fractional control. So far everyone has built the bitmaps
because its the easiest implementation - but I have had requests to support the cache
fixed-point-fraction. Doing it as a percentage is least invasive to resctrl...
> Can the fflags rather depend on the resource type itself, by using the rid?
Sure.
Thanks,
James
>> @@ -2182,14 +2195,14 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn)
>> /* loop over enabled controls, these are all alloc_capable */
>> list_for_each_entry(s, &resctrl_schema_all, list) {
>> r = s->res;
>> - fflags = r->fflags | RFTYPE_CTRL_INFO;
>> + fflags = fflags_from_resource(r) | RFTYPE_CTRL_INFO;
>
> (please watch for extra spaces)
>
>> ret = rdtgroup_mkdir_info_resdir(s, s->name, fflags);
>> if (ret)
>> goto out_destroy;
>> }
>> for_each_mon_capable_rdt_resource(r) {
>> - fflags = r->fflags | RFTYPE_MON_INFO;
>> + fflags = fflags_from_resource(r) | RFTYPE_MON_INFO;
>
> (please watch for extra spaces)
>
> Reinette
next prev parent reply other threads:[~2024-07-01 18:17 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-14 14:59 [PATCH v3 00/38] x86/resctrl: Move the resctrl filesystem code to /fs/resctrl James Morse
2024-06-14 14:59 ` [PATCH v3 01/38] x86/resctrl: Fix allocation of cleanest CLOSID on platforms with no monitors James Morse
2024-06-28 16:41 ` Reinette Chatre
2024-06-14 14:59 ` [PATCH v3 02/38] x86/resctrl: Add a helper to avoid reaching into the arch code resource list James Morse
2024-06-28 16:42 ` Reinette Chatre
2024-06-14 14:59 ` [PATCH v3 03/38] x86/resctrl: Add a schema format enum and use this for fflags James Morse
2024-06-28 16:43 ` Reinette Chatre
2024-07-01 18:17 ` James Morse [this message]
2024-07-01 21:09 ` Reinette Chatre
2024-08-02 17:24 ` James Morse
2024-06-14 14:59 ` [PATCH v3 04/38] x86/resctrl: Use schema type to determine how to parse schema values James Morse
2024-06-28 16:43 ` Reinette Chatre
2024-06-14 15:00 ` [PATCH v3 05/38] x86/resctrl: Use schema type to determine the schema format string James Morse
2024-06-28 16:43 ` Reinette Chatre
2024-06-14 15:00 ` [PATCH v3 06/38] x86/resctrl: Move data_width to be a schema property James Morse
2024-06-28 16:45 ` Reinette Chatre
2024-06-14 15:00 ` [PATCH v3 07/38] x86/resctrl: Add max_bw to struct resctrl_membw James Morse
2024-06-14 15:00 ` [PATCH v3 08/38] x86/resctrl: Generate default_ctrl instead of sharing it James Morse
2024-06-14 15:00 ` [PATCH v3 09/38] x86/resctrl: Add helper for setting CPU default properties James Morse
2024-06-14 15:00 ` [PATCH v3 10/38] x86/resctrl: Remove rdtgroup from update_cpu_closid_rmid() James Morse
2024-06-14 15:00 ` [PATCH v3 11/38] x86/resctrl: Export resctrl fs's init function James Morse
2024-06-14 15:00 ` [PATCH v3 12/38] x86/resctrl: Wrap resctrl_arch_find_domain() around rdt_find_domain() James Morse
2024-06-14 15:00 ` [PATCH v3 13/38] x86/resctrl: Move resctrl types to a separate header James Morse
2024-06-28 16:45 ` Reinette Chatre
2024-07-01 18:16 ` James Morse
2024-06-14 15:00 ` [PATCH v3 14/38] x86/resctrl: Add a resctrl helper to reset all the resources James Morse
2024-06-14 15:00 ` [PATCH v3 15/38] x86/resctrl: Move monitor exit work to a restrl exit call James Morse
2024-06-28 16:46 ` Reinette Chatre
2024-07-01 18:17 ` James Morse
2024-07-11 21:12 ` Carl Worth
2024-06-14 15:00 ` [PATCH v3 16/38] x86/resctrl: Move monitor init work to a resctrl init call James Morse
2024-06-28 16:47 ` Reinette Chatre
2024-07-01 18:17 ` James Morse
2024-07-01 21:11 ` Reinette Chatre
2024-08-02 17:23 ` James Morse
2024-06-14 15:00 ` [PATCH v3 17/38] x86/resctrl: Stop using the for_each_*_rdt_resource() walkers James Morse
2024-06-28 16:48 ` Reinette Chatre
2024-07-01 18:16 ` James Morse
2024-07-01 21:10 ` Reinette Chatre
2024-08-02 17:22 ` James Morse
2024-06-14 15:00 ` [PATCH v3 18/38] x86/resctrl: Export the is_mbm_*_enabled() helpers to asm/resctrl.h James Morse
2024-06-14 15:00 ` [PATCH v3 19/38] x86/resctrl: Add resctrl_arch_is_evt_configurable() to abstract BMEC James Morse
2024-06-14 15:00 ` [PATCH v3 20/38] x86/resctrl: Change mon_event_config_{read,write}() to be arch helpers James Morse
2024-06-28 16:49 ` Reinette Chatre
2024-06-14 15:00 ` [PATCH v3 21/38] x86/resctrl: Move mbm_cfg_mask to struct rdt_resource James Morse
2024-06-28 16:53 ` Reinette Chatre
2024-06-14 15:00 ` [PATCH v3 22/38] x86/resctrl: Add resctrl_arch_ prefix to pseudo lock functions James Morse
2024-06-14 15:00 ` [PATCH v3 23/38] x86/resctrl: Allow an architecture to disable pseudo lock James Morse
2024-07-11 21:33 ` Carl Worth
2024-08-02 17:22 ` James Morse
2024-06-14 15:00 ` [PATCH v3 24/38] x86/resctrl: Make prefetch_disable_bits belong to the arch code James Morse
2024-06-14 15:00 ` [PATCH v3 25/38] x86/resctrl: Make resctrl_arch_pseudo_lock_fn() take a plr James Morse
2024-06-14 15:00 ` [PATCH v3 26/38] x86/resctrl: Move thread_throttle_mode_init() to be managed by resctrl James Morse
2024-06-14 15:00 ` [PATCH v3 27/38] x86/resctrl: Move get_config_index() to a header James Morse
2024-06-14 15:00 ` [PATCH v3 28/38] x86/resctrl: Claim get_domain_from_cpu() for resctrl James Morse
2024-06-14 15:00 ` [PATCH v3 29/38] x86/resctrl: Describe resctrl's bitmap size assumptions James Morse
2024-06-14 15:00 ` [PATCH v3 30/38] x86/resctrl: Rename resctrl_sched_in() to begin with "resctrl_arch_" James Morse
2024-06-14 15:00 ` [PATCH v3 31/38] x86/resctrl: resctrl_exit() teardown resctrl but leave the mount point James Morse
2024-06-28 16:53 ` Reinette Chatre
2024-07-04 16:41 ` James Morse
2024-07-08 17:47 ` Reinette Chatre
2024-08-02 17:28 ` James Morse
2024-06-14 15:00 ` [PATCH v3 32/38] x86/resctrl: Drop __init/__exit on assorted symbols James Morse
2024-06-14 15:00 ` [PATCH v3 33/38] x86/resctrl: Move is_mba_sc() out of core.c James Morse
2024-06-14 15:00 ` [PATCH v3 34/38] x86/resctrl: Add end-marker to the resctrl_event_id enum James Morse
2024-06-14 15:00 ` [PATCH v3 35/38] x86/resctrl: Remove a newline to avoid confusing the code move script James Morse
2024-06-14 15:00 ` [PATCH v3 36/38] fs/resctrl: Add boiler plate for external resctrl code James Morse
2024-06-28 16:54 ` Reinette Chatre
2024-07-04 16:40 ` James Morse
2024-07-08 17:47 ` Reinette Chatre
2024-06-14 15:00 ` [PATCH v3 37/38] x86/resctrl: Move the filesystem bits to headers visible to fs/resctrl James Morse
2024-06-28 17:04 ` Reinette Chatre
2024-06-14 15:00 ` [PATCH v3 38/38] x86/resctrl: Add python script to move resctrl code to /fs/resctrl James Morse
2024-07-11 22:00 ` [PATCH v3 00/38] x86/resctrl: Move the resctrl filesystem " Carl Worth
2024-08-02 17:22 ` James Morse
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=d8e30c4f-04ef-4ed0-9d06-7f735c1c5e90@arm.com \
--to=james.morse@arm.com \
--cc=Babu.Moger@amd.com \
--cc=amitsinght@marvell.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=bobo.shaobowang@huawei.com \
--cc=bp@alien8.de \
--cc=carl@os.amperecomputing.com \
--cc=dave.martin@arm.com \
--cc=david@redhat.com \
--cc=dfustini@baylibre.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peternewman@google.com \
--cc=quic_jiles@quicinc.com \
--cc=reinette.chatre@intel.com \
--cc=rex.nie@jaguarmicro.com \
--cc=scott@os.amperecomputing.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=tan.shaopeng@fujitsu.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xhao@linux.alibaba.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®