From cb41a29076e9f95547da46578d5c8804f7b8845d Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Sat, 20 Apr 2013 17:35:50 +0200 Subject: nohz: Add basic tracing It's not obvious to find out why the full dynticks subsystem doesn't always stop the tick: whether this is due to kthreads, posix timers, perf events, etc... These new tracepoints are here to help the user diagnose the failures and test this feature. Signed-off-by: Frederic Weisbecker Cc: Chris Metcalf Cc: Christoph Lameter Cc: Geoff Levand Cc: Gilad Ben Yossef Cc: Hakan Akkan Cc: Ingo Molnar Cc: Kevin Hilman Cc: Li Zhong Cc: Oleg Nesterov Cc: Paul E. McKenney Cc: Paul Gortmaker Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner --- kernel/time/tick-sched.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'kernel/time') diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 12a900dbb81..85e05ab9825 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -28,6 +28,8 @@ #include "tick-internal.h" +#include + /* * Per cpu nohz control structure */ @@ -153,14 +155,20 @@ static bool can_stop_full_tick(void) { WARN_ON_ONCE(!irqs_disabled()); - if (!sched_can_stop_tick()) + if (!sched_can_stop_tick()) { + trace_tick_stop(0, "more than 1 task in runqueue\n"); return false; + } - if (!posix_cpu_timers_can_stop_tick(current)) + if (!posix_cpu_timers_can_stop_tick(current)) { + trace_tick_stop(0, "posix timers running\n"); return false; + } - if (!perf_event_can_stop_tick()) + if (!perf_event_can_stop_tick()) { + trace_tick_stop(0, "perf events running\n"); return false; + } /* sched_clock_tick() needs us? */ #ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK @@ -168,8 +176,10 @@ static bool can_stop_full_tick(void) * TODO: kick full dynticks CPUs when * sched_clock_stable is set. */ - if (!sched_clock_stable) + if (!sched_clock_stable) { + trace_tick_stop(0, "unstable sched clock\n"); return false; + } #endif return true; @@ -631,6 +641,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, ts->last_tick = hrtimer_get_expires(&ts->sched_timer); ts->tick_stopped = 1; + trace_tick_stop(1, " "); } /* -- cgit v1.2.3