* [PATCH] perf, tracing: add missing __percpu markups
@ 2010-08-11 3:47 Namhyung Kim
2010-08-11 7:52 ` Tejun Heo
2010-08-19 11:24 ` [tip:perf/core] " tip-bot for Namhyung Kim
0 siblings, 2 replies; 4+ messages in thread
From: Namhyung Kim @ 2010-08-11 3:47 UTC (permalink / raw)
To: Frederic Weisbecker, Steven Rostedt, Ingo Molnar
Cc: Peter Zijlstra, Tejun Heo, linux-kernel
ftrace_event_call->perf_events, perf_trace_buf, fgraph_data->cpu_data and
some local variables are percpu pointers but were missing __percpu markup.
Add it.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
include/linux/ftrace_event.h | 4 ++--
kernel/trace/trace_event_perf.c | 15 ++++++++-------
kernel/trace/trace_functions_graph.c | 2 +-
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 3167f2d..c298700 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -184,8 +184,8 @@ struct ftrace_event_call {
unsigned int flags;
#ifdef CONFIG_PERF_EVENTS
- int perf_refcount;
- struct hlist_head *perf_events;
+ int perf_refcount;
+ struct hlist_head __percpu *perf_events;
#endif
};
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index 8a2b73f..7bd800a 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -11,7 +11,7 @@
EXPORT_SYMBOL_GPL(perf_arch_fetch_caller_regs);
-static char *perf_trace_buf[4];
+static char __percpu *perf_trace_buf[4];
/*
* Force it to be aligned to unsigned long to avoid misaligned accesses
@@ -26,7 +26,7 @@ static int total_ref_count;
static int perf_trace_event_init(struct ftrace_event_call *tp_event,
struct perf_event *p_event)
{
- struct hlist_head *list;
+ struct hlist_head __percpu *list;
int ret = -ENOMEM;
int cpu;
@@ -44,11 +44,11 @@ static int perf_trace_event_init(struct ftrace_event_call *tp_event,
tp_event->perf_events = list;
if (!total_ref_count) {
- char *buf;
+ char __percpu *buf;
int i;
for (i = 0; i < 4; i++) {
- buf = (char *)alloc_percpu(perf_trace_t);
+ buf = (char __percpu *)alloc_percpu(perf_trace_t);
if (!buf)
goto fail;
@@ -112,13 +112,14 @@ int perf_trace_init(struct perf_event *p_event)
int perf_trace_enable(struct perf_event *p_event)
{
struct ftrace_event_call *tp_event = p_event->tp_event;
+ struct hlist_head __percpu *pcpu_list;
struct hlist_head *list;
- list = tp_event->perf_events;
- if (WARN_ON_ONCE(!list))
+ pcpu_list = tp_event->perf_events;
+ if (WARN_ON_ONCE(!pcpu_list))
return -EINVAL;
- list = this_cpu_ptr(list);
+ list = this_cpu_ptr(pcpu_list);
hlist_add_head_rcu(&p_event->hlist_entry, list);
return 0;
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 79f4bac..e4d8dea 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -23,7 +23,7 @@ struct fgraph_cpu_data {
};
struct fgraph_data {
- struct fgraph_cpu_data *cpu_data;
+ struct fgraph_cpu_data __percpu *cpu_data;
/* Place to preserve last processed entry. */
struct ftrace_graph_ent_entry ent;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] perf, tracing: add missing __percpu markups
2010-08-11 3:47 [PATCH] perf, tracing: add missing __percpu markups Namhyung Kim
@ 2010-08-11 7:52 ` Tejun Heo
2010-08-11 14:11 ` Frederic Weisbecker
2010-08-19 11:24 ` [tip:perf/core] " tip-bot for Namhyung Kim
1 sibling, 1 reply; 4+ messages in thread
From: Tejun Heo @ 2010-08-11 7:52 UTC (permalink / raw)
To: Namhyung Kim
Cc: Frederic Weisbecker, Steven Rostedt, Ingo Molnar, Peter Zijlstra,
linux-kernel
On 08/11/2010 05:47 AM, Namhyung Kim wrote:
> ftrace_event_call->perf_events, perf_trace_buf, fgraph_data->cpu_data and
> some local variables are percpu pointers but were missing __percpu markup.
> Add it.
>
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a mersage 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/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf, tracing: add missing __percpu markups
2010-08-11 7:52 ` Tejun Heo
@ 2010-08-11 14:11 ` Frederic Weisbecker
0 siblings, 0 replies; 4+ messages in thread
From: Frederic Weisbecker @ 2010-08-11 14:11 UTC (permalink / raw)
To: Tejun Heo
Cc: Namhyung Kim, Steven Rostedt, Ingo Molnar, Peter Zijlstra,
linux-kernel
On Wed, Aug 11, 2010 at 09:52:20AM +0200, Tejun Heo wrote:
> On 08/11/2010 05:47 AM, Namhyung Kim wrote:
> > ftrace_event_call->perf_events, perf_trace_buf, fgraph_data->cpu_data and
> > some local variables are percpu pointers but were missing __percpu markup.
> > Add it.
> >
> > Signed-off-by: Namhyung Kim <namhyung@gmail.com>
>
> Acked-by: Tejun Heo <tj@kernel.org>
Queued, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:perf/core] perf, tracing: add missing __percpu markups
2010-08-11 3:47 [PATCH] perf, tracing: add missing __percpu markups Namhyung Kim
2010-08-11 7:52 ` Tejun Heo
@ 2010-08-19 11:24 ` tip-bot for Namhyung Kim
1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Namhyung Kim @ 2010-08-19 11:24 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, eranian, paulus, acme, hpa, mingo, a.p.zijlstra,
namhyung, fweisbec, rostedt, tj, tglx, mingo
Commit-ID: 6016ee13db518ab1cd0cbf43fc2ad5712021e338
Gitweb: http://git.kernel.org/tip/6016ee13db518ab1cd0cbf43fc2ad5712021e338
Author: Namhyung Kim <namhyung@gmail.com>
AuthorDate: Wed, 11 Aug 2010 12:47:59 +0900
Committer: Frederic Weisbecker <fweisbec@gmail.com>
CommitDate: Thu, 19 Aug 2010 01:33:05 +0200
perf, tracing: add missing __percpu markups
ftrace_event_call->perf_events, perf_trace_buf,
fgraph_data->cpu_data and some local variables are percpu pointers
missing __percpu markups. Add them.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <1281498479-28551-1-git-send-email-namhyung@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
include/linux/ftrace_event.h | 4 ++--
kernel/trace/trace_event_perf.c | 15 ++++++++-------
kernel/trace/trace_functions_graph.c | 2 +-
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 02b8b24..5f8ad7b 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -191,8 +191,8 @@ struct ftrace_event_call {
unsigned int flags;
#ifdef CONFIG_PERF_EVENTS
- int perf_refcount;
- struct hlist_head *perf_events;
+ int perf_refcount;
+ struct hlist_head __percpu *perf_events;
#endif
};
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index db2eae2..92f5477 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -9,7 +9,7 @@
#include <linux/kprobes.h>
#include "trace.h"
-static char *perf_trace_buf[PERF_NR_CONTEXTS];
+static char __percpu *perf_trace_buf[PERF_NR_CONTEXTS];
/*
* Force it to be aligned to unsigned long to avoid misaligned accesses
@@ -24,7 +24,7 @@ static int total_ref_count;
static int perf_trace_event_init(struct ftrace_event_call *tp_event,
struct perf_event *p_event)
{
- struct hlist_head *list;
+ struct hlist_head __percpu *list;
int ret = -ENOMEM;
int cpu;
@@ -42,11 +42,11 @@ static int perf_trace_event_init(struct ftrace_event_call *tp_event,
tp_event->perf_events = list;
if (!total_ref_count) {
- char *buf;
+ char __percpu *buf;
int i;
for (i = 0; i < PERF_NR_CONTEXTS; i++) {
- buf = (char *)alloc_percpu(perf_trace_t);
+ buf = (char __percpu *)alloc_percpu(perf_trace_t);
if (!buf)
goto fail;
@@ -102,13 +102,14 @@ int perf_trace_init(struct perf_event *p_event)
int perf_trace_enable(struct perf_event *p_event)
{
struct ftrace_event_call *tp_event = p_event->tp_event;
+ struct hlist_head __percpu *pcpu_list;
struct hlist_head *list;
- list = tp_event->perf_events;
- if (WARN_ON_ONCE(!list))
+ pcpu_list = tp_event->perf_events;
+ if (WARN_ON_ONCE(!pcpu_list))
return -EINVAL;
- list = this_cpu_ptr(list);
+ list = this_cpu_ptr(pcpu_list);
hlist_add_head_rcu(&p_event->hlist_entry, list);
return 0;
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 6bff236..fcb5a54 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -23,7 +23,7 @@ struct fgraph_cpu_data {
};
struct fgraph_data {
- struct fgraph_cpu_data *cpu_data;
+ struct fgraph_cpu_data __percpu *cpu_data;
/* Place to preserve last processed entry. */
struct ftrace_graph_ent_entry ent;
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-19 11:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-11 3:47 [PATCH] perf, tracing: add missing __percpu markups Namhyung Kim
2010-08-11 7:52 ` Tejun Heo
2010-08-11 14:11 ` Frederic Weisbecker
2010-08-19 11:24 ` [tip:perf/core] " tip-bot for Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox