[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-96681fc3c9e7d1f89ab64e5eec40b6467c97680f@git.kernel.org>
Date: Fri, 22 Oct 2010 13:04:51 GMT
From: tip-bot for Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, eranian@...gle.com, hpa@...or.com,
mingo@...hat.com, a.p.zijlstra@...llo.nl, tglx@...utronix.de,
mingo@...e.hu
Subject: [tip:perf/urgent] perf, x86: Use NUMA aware allocations for PEBS/BTS/DS allocations
Commit-ID: 96681fc3c9e7d1f89ab64e5eec40b6467c97680f
Gitweb: http://git.kernel.org/tip/96681fc3c9e7d1f89ab64e5eec40b6467c97680f
Author: Peter Zijlstra <a.p.zijlstra@...llo.nl>
AuthorDate: Tue, 19 Oct 2010 14:55:33 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 22 Oct 2010 14:18:26 +0200
perf, x86: Use NUMA aware allocations for PEBS/BTS/DS allocations
For performance reasons its best to use memory node local memory for
per-cpu buffers.
This logic comes from a much larger patch proposed by Stephane.
Suggested-by: Stephane Eranian <eranian@...gle.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Acked-by: Stephane Eranian <eranian@...gle.com>
LKML-Reference: <20101019134808.514465326@...llo.nl>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
arch/x86/kernel/cpu/perf_event_intel_ds.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
index 8a7f81c..b7dcd9f 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -77,13 +77,14 @@ static void fini_debug_store_on_cpu(int cpu)
static int alloc_pebs_buffer(int cpu)
{
struct debug_store *ds = per_cpu(cpu_hw_events, cpu).ds;
+ int node = cpu_to_node(cpu);
int max, thresh = 1; /* always use a single PEBS record */
void *buffer;
if (!x86_pmu.pebs)
return 0;
- buffer = kzalloc(PEBS_BUFFER_SIZE, GFP_KERNEL);
+ buffer = kmalloc_node(PEBS_BUFFER_SIZE, GFP_KERNEL | __GFP_ZERO, node);
if (unlikely(!buffer))
return -ENOMEM;
@@ -114,13 +115,14 @@ static void release_pebs_buffer(int cpu)
static int alloc_bts_buffer(int cpu)
{
struct debug_store *ds = per_cpu(cpu_hw_events, cpu).ds;
+ int node = cpu_to_node(cpu);
int max, thresh;
void *buffer;
if (!x86_pmu.bts)
return 0;
- buffer = kzalloc(BTS_BUFFER_SIZE, GFP_KERNEL);
+ buffer = kmalloc_node(BTS_BUFFER_SIZE, GFP_KERNEL | __GFP_ZERO, node);
if (unlikely(!buffer))
return -ENOMEM;
@@ -150,9 +152,10 @@ static void release_bts_buffer(int cpu)
static int alloc_ds_buffer(int cpu)
{
+ int node = cpu_to_node(cpu);
struct debug_store *ds;
- ds = kzalloc(sizeof(*ds), GFP_KERNEL);
+ ds = kmalloc_node(sizeof(*ds), GFP_KERNEL | __GFP_ZERO, node);
if (unlikely(!ds))
return -ENOMEM;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists