[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ea62c5fc-0022-40fd-a565-de6d6e8d72da@arm.com>
Date: Mon, 10 Feb 2025 13:22:26 +0000
From: James Morse <james.morse@....com>
To: Reinette Chatre <reinette.chatre@...el.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Cc: Fenghua Yu <fenghua.yu@...el.com>, 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>, Shaopeng Tan <tan.shaopeng@...fujitsu.com>
Subject: Re: [PATCH v5 27/40] x86/resctrl: Move thread_throttle_mode_init() to
be managed by resctrl
Hi Reinette,
On 23/10/2024 23:59, Reinette Chatre wrote:
> On 10/4/24 11:03 AM, James Morse wrote:
>> thread_throttle_mode_init() is called from the architecture specific code
>> to make the 'thread_throttle_mode' file visible. The architecture specific
>> code has already set the membw.throttle_mode in the rdt_resource.
>>
>> This doesn't need to be specific to the architecture, the throttle_mode
>> can be used by resctrl to determine if the 'thread_throttle_mode' file
>> should be visible.
>>
>> Call thread_throttle_mode_init() from resctrl_setup(), check the
>> membw.throttle_mode on the MBA resource. This avoids publishing an
>> extra function between the architecture and filesystem code.
>> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> index 3f10e6897daa..596f5f087834 100644
>> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> @@ -2048,10 +2048,15 @@ static struct rftype *rdtgroup_get_rftype_by_name(const char *name)
>> return NULL;
>> }
>>
>> -void __init thread_throttle_mode_init(void)
>> +static void __init thread_throttle_mode_init(void)
>> {
>> + struct rdt_resource *r = resctrl_arch_get_resource(RDT_RESOURCE_MBA);
>> struct rftype *rft;
>>
>> + if (!r->alloc_capable ||
>> + r->membw.throttle_mode == THREAD_THROTTLE_UNDEFINED)
>> + return;
>> +
>
> The goal from the changelog is to make "thread_throttle_mode_init()" not be specific
> to an architecture. It does so by checking the value of rdt_resource->resctrl_membw->membw_throttle_mode.
> I thus expect that as part of being non-architectural it should check this for all
> resources that initialize resctrl_membw, this includes RDT_RESOURCE_SMBA.
Sure.
Adding this creates the new corner-case where MBA has a throttle_mode but SMBA does not.
I'll add the corresponding logic to rdt_thread_throttle_mode_show() to print 'undefined'
to user-space if that ever happens.
Thanks,
James
Powered by blists - more mailing lists