[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <SJ1PR11MB60837F47723BE9B41B1F05E8FC272@SJ1PR11MB6083.namprd11.prod.outlook.com>
Date: Fri, 8 Mar 2024 18:50:42 +0000
From: "Luck, Tony" <tony.luck@...el.com>
To: James Morse <james.morse@....com>, "Yu, Fenghua" <fenghua.yu@...el.com>,
"Chatre, Reinette" <reinette.chatre@...el.com>, Peter Newman
<peternewman@...gle.com>, Jonathan Corbet <corbet@....net>, Shuah Khan
<skhan@...uxfoundation.org>, "x86@...nel.org" <x86@...nel.org>
CC: Shaopeng Tan <tan.shaopeng@...itsu.com>, Jamie Iles
<quic_jiles@...cinc.com>, Babu Moger <babu.moger@....com>, Randy Dunlap
<rdunlap@...radead.org>, Drew Fustini <dfustini@...libre.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"patches@...ts.linux.dev" <patches@...ts.linux.dev>
Subject: RE: [PATCH v4 1/2] x86/resctrl: Pass domain to target CPU
> > + hw_dom->ctrl_val[idx] = cfg->new_ctrl;
> > + cpu = cpumask_any(&d->cpu_mask);
>
> If this CPU is part of the domain, then cpumask_any() could chose a different CPU leading
> to an IPI, where this CPU could have done the work itself.
> smp_call_function_any() has the logic to try and run on this CPU if possible.
>
> As d->cpu_mask is still valid when you call smp_call_function_single(), could we use
> smp_call_function_any() instead?
I'd thought that cpumask_any() was smarter. But I see that it dumbly just picks the first
CPU in the mask. Great suggestion, will add to next version.
>> - cpumask_set_cpu(cpumask_any(&d->cpu_mask), cpu_mask);
>> + cpu = cpumask_any(&d->cpu_mask);
>
> Same comment about picking an unlucky CPU here, smp_call_function_any() can improve our
> chances.
Will fix here too.
> Still:
> Reviewed-by: James Morse <james.morse@....com>
Thanks!
-Tony
Powered by blists - more mailing lists