[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8e14da3a-7335-471f-aa4c-f871e67c9862@arm.com>
Date: Wed, 7 May 2025 17:48:08 +0100
From: James Morse <james.morse@....com>
To: Reinette Chatre <reinette.chatre@...el.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, H Peter Anvin <hpa@...or.com>,
Babu Moger <Babu.Moger@....com>, shameerali.kolothum.thodi@...wei.com,
D Scott Phillips OS <scott@...amperecomputing.com>,
carl@...amperecomputing.com, lcherian@...vell.com,
bobo.shaobowang@...wei.com, tan.shaopeng@...itsu.com,
baolin.wang@...ux.alibaba.com, Jamie Iles <quic_jiles@...cinc.com>,
Xin Hao <xhao@...ux.alibaba.com>, peternewman@...gle.com,
dfustini@...libre.com, amitsinght@...vell.com,
David Hildenbrand <david@...hat.com>, Rex Nie <rex.nie@...uarmicro.com>,
Dave Martin <dave.martin@....com>, Koba Ko <kobak@...dia.com>,
Shanker Donthineni <sdonthineni@...dia.com>, fenghuay@...dia.com,
Tony Luck <tony.luck@...el.com>
Subject: Re: [PATCH v9 08/27] x86/resctrl: Expand the width of domid by
replacing mon_data_bits
Hi Reinette,
On 01/05/2025 18:04, Reinette Chatre wrote:
> On 4/25/25 10:37 AM, James Morse wrote:
>> diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> index 0a0ac5f6112e..159972c3fe73 100644
>> --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> @@ -667,7 +667,7 @@ int rdtgroup_mondata_show(struct seq_file *m, void *arg)
>> u32 resid, evtid, domid;
>
> I was expecting this to look differently after reading
> https://lore.kernel.org/lkml/a9008c2d-e83d-4bc6-8197-0753666a7ec2@arm.com/
I changed the structure, but missed the usage here.
> I believe u32 was used for resid, evtid, and domid because of how they
> used to be initialized from the bitfield within the union. With the switch to
> a struct that now has the proper types these can also use proper types.
>
> enum resctrl_res_level resid;
> enum resctrl_event_id evtid;
> int domid;
>
> This highlights that the incorrect type propagated from rdtgroup_mondata_show()
> to mon_event_read() where its "int evtid" parameter should also be
> "enum resctrl_event_id evtid", which is a good complement to patch #14
> that fixes the type used by functions called by mon_event_read().
Fixed now.
[...]
>> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> index eccdfcb1a6f5..7ef5cf0c4d1d 100644
>> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> @@ -45,6 +45,12 @@ LIST_HEAD(rdt_all_groups);
>> +/**
>> + * mon_get_kn_priv() - Get the mon_data priv data for this event.
>> + *
>> + * The same values are used across the mon_data directories of all control and
>> + * monitor groups for the same event in the same domain. Keep a list of
>> + * allocated structures and re-use an existing one with the same values for
>> + * @rid, @domid, etc.
>> + *
>> + * @rid: The resource id for the event file being created.
>> + * @domid: The domain id for the event file being created.
>> + * @mevt: The type of event file being created.
>> + * @do_sum: Whether SNC summing monitors are being created.
>> + */
>> +static struct mon_data *mon_get_kn_priv(int rid, int domid,
>
> "int rid" -> "enum resctrl_res_level rid"
Fixed.
Thanks,
James
Powered by blists - more mailing lists