[PATCH v5 7/7] powerpc/powernv: nest pmu cpumask and cpu hotplug support
Daniel Axtens
dja at axtens.net
Thu Jul 23 16:49:02 AEST 2015
On Thu, 2015-07-23 at 12:18 +0530, Madhavan Srinivasan wrote:
>
> On Wednesday 22 July 2015 10:33 AM, Daniel Axtens wrote:
> >> +static void nest_change_cpu_context(int old_cpu, int new_cpu)
> >> +{
> >> + int i;
> >> +
> >> + for (i = 0; per_nest_pmu_arr[i] != NULL; i++)
> >> + perf_pmu_migrate_context(&per_nest_pmu_arr[i]->pmu,
> >> + old_cpu, new_cpu);
> > From patch 4, I see per_nest_pmu_arr is defined as:
> > +static struct nest_pmu *per_nest_pmu_arr[P8_NEST_MAX_PMUS];
> >
> > Therefore, does this loop need to have a check that
> > i < P8_NEST_MAX_PMUS?
>
> No, that is max possible pmu, but we may have only couple for nest pmus
> registered.
>
What if we have P8_NEST_MAX_PMUS registered? Then we'll check beyond the
end of the array...
> Thanks for the review comments
> Maddy
> >
>
--
Regards,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 860 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20150723/ccc2b57e/attachment.sig>
More information about the Linuxppc-dev
mailing list