Commit 73c4427c authored by Yan, Zheng's avatar Yan, Zheng Committed by Ingo Molnar

perf/x86/intel/uncore: Don't use smp_processor_id() in validate_group()

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: default avatarYan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1379400493-11505-1-git-send-email-zheng.z.yan@intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent c5ecceef
...@@ -2706,14 +2706,14 @@ static void uncore_pmu_init_hrtimer(struct intel_uncore_box *box) ...@@ -2706,14 +2706,14 @@ static void uncore_pmu_init_hrtimer(struct intel_uncore_box *box)
box->hrtimer.function = uncore_pmu_hrtimer; box->hrtimer.function = uncore_pmu_hrtimer;
} }
struct intel_uncore_box *uncore_alloc_box(struct intel_uncore_type *type, int cpu) static struct intel_uncore_box *uncore_alloc_box(struct intel_uncore_type *type, int node)
{ {
struct intel_uncore_box *box; struct intel_uncore_box *box;
int i, size; int i, size;
size = sizeof(*box) + type->num_shared_regs * sizeof(struct intel_uncore_extra_reg); size = sizeof(*box) + type->num_shared_regs * sizeof(struct intel_uncore_extra_reg);
box = kzalloc_node(size, GFP_KERNEL, cpu_to_node(cpu)); box = kzalloc_node(size, GFP_KERNEL, node);
if (!box) if (!box)
return NULL; return NULL;
...@@ -3031,7 +3031,7 @@ static int uncore_validate_group(struct intel_uncore_pmu *pmu, ...@@ -3031,7 +3031,7 @@ static int uncore_validate_group(struct intel_uncore_pmu *pmu,
struct intel_uncore_box *fake_box; struct intel_uncore_box *fake_box;
int ret = -EINVAL, n; int ret = -EINVAL, n;
fake_box = uncore_alloc_box(pmu->type, smp_processor_id()); fake_box = uncore_alloc_box(pmu->type, NUMA_NO_NODE);
if (!fake_box) if (!fake_box)
return -ENOMEM; return -ENOMEM;
...@@ -3294,7 +3294,7 @@ static int uncore_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id ...@@ -3294,7 +3294,7 @@ static int uncore_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id
} }
type = pci_uncores[UNCORE_PCI_DEV_TYPE(id->driver_data)]; type = pci_uncores[UNCORE_PCI_DEV_TYPE(id->driver_data)];
box = uncore_alloc_box(type, 0); box = uncore_alloc_box(type, NUMA_NO_NODE);
if (!box) if (!box)
return -ENOMEM; return -ENOMEM;
...@@ -3499,7 +3499,7 @@ static int uncore_cpu_prepare(int cpu, int phys_id) ...@@ -3499,7 +3499,7 @@ static int uncore_cpu_prepare(int cpu, int phys_id)
if (pmu->func_id < 0) if (pmu->func_id < 0)
pmu->func_id = j; pmu->func_id = j;
box = uncore_alloc_box(type, cpu); box = uncore_alloc_box(type, cpu_to_node(cpu));
if (!box) if (!box)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment