Re: [PATCH] perf/x86/intel/uncore: don't use smp_processor_id() in validate_group()

From: Bjorn Helgaas
Date: Thu Sep 19 2013 - 23:28:16 EST


On Wed, Sep 18, 2013 at 5:31 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Tue, Sep 17, 2013 at 02:48:13PM +0800, Yan, Zheng wrote:
>> From: "Yan, Zheng" <zheng.z.yan@xxxxxxxxx>
>>
>> uncore_validate_group() can't call smp_processor_id() because it is
>> in preemptible context. Pass NUMA_NO_NODE to the allocator instead.
>>
>> Signed-off-by: Yan, Zheng <zheng.z.yan@xxxxxxxxx>
>> ---
>> arch/x86/kernel/cpu/perf_event_intel_uncore.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
>> index fd8011e..11b1582 100644
>> --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
>> +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
>> @@ -3031,7 +3031,7 @@ static int uncore_validate_group(struct intel_uncore_pmu *pmu,
>> struct intel_uncore_box *fake_box;
>> int ret = -EINVAL, n;
>>
>> - fake_box = uncore_alloc_box(pmu->type, smp_processor_id());
>> + fake_box = uncore_alloc_box(pmu->type, NUMA_NO_NODE);
>
> Doesn't work since you're passing cpu, not node.
>
> I changed it to the below. However upon doing so I noticed you
> hard coded PCI devices live on Node0, this is not true in general
> (although likely true for tiny systems).
>
> I've absolutely no clue about the entire PCI layer, but it would be nice
> if there's a method to extract the local node of a pci device.
>
> Bjorn is there such a thing?

dev_to_node(&pdev->dev), as in pci_call_probe()?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/