Skip to content

Commit

Permalink
Merge branch 'timers/nohz-help-testing' of git://git.kernel.org/pub/s…
Browse files Browse the repository at this point in the history
…cm/linux/kernel/git/frederic/linux-dynticks into timers/nohz

Pull full dynticks helpers from Frederic Weisbecker:

 - handy tracepoints that allow dynticks analysis,
   to answer "why does my tick not stop??" questions

 - select CONFIG_RCU_NOCB_ALL

Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Apr 24, 2013
2 parents bf967be + cb41a29 commit 447a34a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
21 changes: 21 additions & 0 deletions include/trace/events/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,27 @@ TRACE_EVENT(itimer_expire,
(int) __entry->pid, (unsigned long long)__entry->now)
);

#ifdef CONFIG_NO_HZ_FULL
TRACE_EVENT(tick_stop,

TP_PROTO(int success, char *error_msg),

TP_ARGS(success, error_msg),

TP_STRUCT__entry(
__field( int , success )
__string( msg, error_msg )
),

TP_fast_assign(
__entry->success = success;
__assign_str(msg, error_msg);
),

TP_printk("success=%s msg=%s", __entry->success ? "yes" : "no", __get_str(msg))
);
#endif

#endif /* _TRACE_TIMER_H */

/* This part must be outside protection */
Expand Down
1 change: 1 addition & 0 deletions kernel/time/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ config NO_HZ_FULL
select NO_HZ_COMMON
select RCU_USER_QS
select RCU_NOCB_CPU
select RCU_NOCB_CPU_ALL
select CONTEXT_TRACKING_FORCE
select IRQ_WORK
help
Expand Down
19 changes: 15 additions & 4 deletions kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

#include "tick-internal.h"

#include <trace/events/timer.h>

/*
* Per cpu nohz control structure
*/
Expand Down Expand Up @@ -153,23 +155,31 @@ 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
/*
* 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;
Expand Down Expand Up @@ -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, " ");
}

/*
Expand Down

0 comments on commit 447a34a

Please sign in to comment.