Commit 01ef09d9 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

perf_counter: fix uninitialized usage of event_list

Impact: fix boot crash

When doing the generic context switch event I ran into some early
boot hangs, which were caused by inf func recursion (event, fault,
event, fault).

I eventually tracked it down to event_list not being initialized
at the time of the first event. Fix this.
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Orig-LKML-Reference: <20090319194233.195392657@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b6c5a71d
...@@ -124,6 +124,8 @@ extern struct cred init_cred; ...@@ -124,6 +124,8 @@ extern struct cred init_cred;
# define INIT_PERF_COUNTERS(tsk) \ # define INIT_PERF_COUNTERS(tsk) \
.perf_counter_ctx.counter_list = \ .perf_counter_ctx.counter_list = \
LIST_HEAD_INIT(tsk.perf_counter_ctx.counter_list), \ LIST_HEAD_INIT(tsk.perf_counter_ctx.counter_list), \
.perf_counter_ctx.event_list = \
LIST_HEAD_INIT(tsk.perf_counter_ctx.event_list), \
.perf_counter_ctx.lock = \ .perf_counter_ctx.lock = \
__SPIN_LOCK_UNLOCKED(tsk.perf_counter_ctx.lock), __SPIN_LOCK_UNLOCKED(tsk.perf_counter_ctx.lock),
#else #else
......
...@@ -1506,7 +1506,7 @@ static void perf_swcounter_ctx_event(struct perf_counter_context *ctx, ...@@ -1506,7 +1506,7 @@ static void perf_swcounter_ctx_event(struct perf_counter_context *ctx,
{ {
struct perf_counter *counter; struct perf_counter *counter;
if (list_empty(&ctx->event_list)) if (system_state != SYSTEM_RUNNING || list_empty(&ctx->event_list))
return; return;
rcu_read_lock(); rcu_read_lock();
......
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