Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1190660 > unrolled thread

Re: [PATCH v5 7/7] powerpc/powernv: nest pmu cpumask and cpu hotplug support

Started byMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
First post2015-07-23 08:50 +0200
Last post2015-07-23 09:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v5 7/7] powerpc/powernv: nest pmu cpumask and cpu hotplug  support Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2015-07-23 08:50 +0200
    Re: [PATCH v5 7/7] powerpc/powernv: nest pmu cpumask and cpu  hotplug support Daniel Axtens <dja@axtens.net> - 2015-07-23 09:00 +0200
      Re: [PATCH v5 7/7] powerpc/powernv: nest pmu cpumask and cpu hotplug  support Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2015-07-23 09:30 +0200

#1190660 — Re: [PATCH v5 7/7] powerpc/powernv: nest pmu cpumask and cpu hotplug support

FromMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
Date2015-07-23 08:50 +0200
SubjectRe: [PATCH v5 7/7] powerpc/powernv: nest pmu cpumask and cpu hotplug support
Message-ID<pPium-7ld-13@gated-at.bofh.it>

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.

Thanks for the review comments
Maddy
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1190667 — Re: [PATCH v5 7/7] powerpc/powernv: nest pmu cpumask and cpu hotplug support

FromDaniel Axtens <dja@axtens.net>
Date2015-07-23 09:00 +0200
SubjectRe: [PATCH v5 7/7] powerpc/powernv: nest pmu cpumask and cpu hotplug support
Message-ID<pPiE2-7wA-15@gated-at.bofh.it>
In reply to#1190660

[Multipart message — attachments visible in raw view] — view raw

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

[toc] | [prev] | [next] | [standalone]


#1190683

FromMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
Date2015-07-23 09:30 +0200
Message-ID<pPj75-8jO-39@gated-at.bofh.it>
In reply to#1190667

On Thursday 23 July 2015 12:19 PM, Daniel Axtens wrote:
> 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...

OK, i will add check for P8_NEST_MAX_PMUS also.

>> Thanks for the review comments
>> Maddy

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web