[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1602171036450.3157@vshiva-Udesk>
Date: Wed, 17 Feb 2016 10:48:18 -0800 (PST)
From: Vikas Shivappa <vikas.shivappa@...el.com>
To: Thomas Gleixner <tglx@...utronix.de>
cc: Vikas Shivappa <vikas.shivappa@...el.com>,
LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>, x86@...nel.org,
Stephane Eranian <eranian@...gle.com>,
Matt Fleming <matt@...eblueprint.co.uk>
Subject: Re: [PATCH] x86/perf/intel/cqm: Get rid of the silly for_each_cpu
lookups
On Wed, 17 Feb 2016, Thomas Gleixner wrote:
> On Wed, 17 Feb 2016, Vikas Shivappa wrote:
>
> Yes, please resend the rapl one. perf_uncore is a different trainwreck which I
> fixed already:
>
> lkml.kernel.org/r/20160217132903.767990400@...utronix.de
Ok , will resend the rapl separately.
the fix i sent however was a little different in that it uses a static
tmp_cpumask to avoid the loop in the cpumask_and_any below -
while ((n = cpumask_next(n, src1p)) < nr_cpu_ids)
if (cpumask_test_cpu(n, src2p))
But we have an extra static - static to avoid having it in the
stack..
copy below -
+/*
+ * Temporary cpumask used during hot cpu notificaiton handling. The usage
+ * is serialized by hot cpu locks.
+ */
+static cpumask_t tmp_cpumask;
+
static void rapl_cpu_init(int cpu)
{
- int i, phys_id = topology_physical_package_id(cpu);
-
- /* check if phys_is is already covered */
- for_each_cpu(i, &rapl_cpu_mask) {
- if (phys_id == topology_physical_package_id(i))
- return;
- }
- /* was not found, so add it */
- cpumask_set_cpu(cpu, &rapl_cpu_mask);
+ /* check if cpu's package is already covered.If not, add it.*/
+ cpumask_and(&tmp_cpumask, &rapl_cpu_mask, topology_core_cpumask(cpu));
+ if (cpumask_empty(&tmp_cpumask))
+ cpumask_set_cpu(cpu, &rapl_cpu_mask);
}
Thanks,
Vikas
>
> Thanks,
>
> tglx
>
Powered by blists - more mailing lists