diff options
author | Peter Zijlstra <peterz@infradead.org> | 2014-10-08 12:51:10 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-10-08 19:51:01 -0400 |
commit | fe0e01c77dd9f7a60916aec2149d8a1182baf63c (patch) | |
tree | 471eff9f1eefdacc887936f196c7be2e3f7af40d | |
parent | bfe01a5ba2490f299e1d2d5508cbbbadd897bbe9 (diff) |
tracing: Robustify wait loop
The pending nested sleep debugging triggered on the potential stale
TASK_INTERRUPTIBLE in this code.
While there, fix the loop such that we won't revert to a while(1)
yield() 'spin' loop if we ever get a spurious wakeup.
And fix the actual issue by properly terminating the 'wait' loop by
setting TASK_RUNNING.
Link: http://lkml.kernel.org/p/20141008165110.GA14547@worktop.programming.kicks-ass.net
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel/trace/trace_events.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index ef06ce7e9cf8..0cc51edde3a8 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -2513,8 +2513,11 @@ static __init int event_test_thread(void *unused) | |||
2513 | kfree(test_malloc); | 2513 | kfree(test_malloc); |
2514 | 2514 | ||
2515 | set_current_state(TASK_INTERRUPTIBLE); | 2515 | set_current_state(TASK_INTERRUPTIBLE); |
2516 | while (!kthread_should_stop()) | 2516 | while (!kthread_should_stop()) { |
2517 | schedule(); | 2517 | schedule(); |
2518 | set_current_state(TASK_INTERRUPTIBLE); | ||
2519 | } | ||
2520 | __set_current_state(TASK_RUNNING); | ||
2518 | 2521 | ||
2519 | return 0; | 2522 | return 0; |
2520 | } | 2523 | } |