From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752373Ab2LTSms (ORCPT ); Thu, 20 Dec 2012 13:42:48 -0500 Received: from mail-we0-f179.google.com ([74.125.82.179]:48516 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752144Ab2LTSmk (ORCPT ); Thu, 20 Dec 2012 13:42:40 -0500 From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Alessio Igor Bogani , Andrew Morton , Avi Kivity , Chris Metcalf , Christoph Lameter , Geoff Levand , Gilad Ben Yossef , Hakan Akkan , Ingo Molnar , "Paul E. McKenney" , Paul Gortmaker , Peter Zijlstra , Steven Rostedt , Thomas Gleixner Subject: [PATCH 24/24] nohz: Add some tracing Date: Thu, 20 Dec 2012 19:33:11 +0100 Message-Id: <1356028391-14427-25-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1356028391-14427-1-git-send-email-fweisbec@gmail.com> References: <1356028391-14427-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Not for merge, just for debugging. Signed-off-by: Frederic Weisbecker Cc: Alessio Igor Bogani Cc: Andrew Morton Cc: Avi Kivity Cc: Chris Metcalf Cc: Christoph Lameter Cc: Geoff Levand Cc: Gilad Ben Yossef Cc: Hakan Akkan Cc: Ingo Molnar Cc: Paul E. McKenney Cc: Paul Gortmaker Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner --- kernel/time/tick-sched.c | 27 ++++++++++++++++++++++----- 1 files changed, 22 insertions(+), 5 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 4f4fa13..f75a85f 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -142,6 +142,7 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs) ts->idle_jiffies++; } #endif + trace_printk("tick\n"); update_process_times(user_mode(regs)); profile_tick(CPU_PROFILING); } @@ -589,17 +590,30 @@ void tick_nohz_idle_enter(void) #ifdef CONFIG_NO_HZ_FULL static bool can_stop_full_tick(int cpu) { - if (!sched_can_stop_tick()) + if (!sched_can_stop_tick()) { + trace_printk("Can't stop: sched\n"); return false; + } - if (!rcu_is_nocb_cpu(cpu)) + if (!rcu_is_nocb_cpu(cpu)) { + trace_printk("Can't stop: not RCU nocb\n"); return false; + } - if (rcu_pending(cpu)) + /* + * Keep the tick if we are asked to report a quiescent state. + * This must be further optimized (avoid checks for local callbacks, + * ignore RCU in userspace, etc... + */ + if (rcu_pending(cpu)) { + trace_printk("Can't stop: RCU pending\n"); return false; + } - if (posix_cpu_timers_running(current)) + if (posix_cpu_timers_running(current)) { + trace_printk("Can't stop: posix CPU timers running\n"); return false; + } return true; } @@ -613,12 +627,15 @@ static void tick_nohz_full_stop_tick(struct tick_sched *ts) if (!tick_nohz_full_cpu(cpu) || is_idle_task(current)) return; - if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE) + if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE) { + trace_printk("Can't stop: NOHZ_MODE_INACTIVE\n"); return; + } if (!can_stop_full_tick(cpu)) return; + trace_printk("Stop tick\n"); tick_nohz_stop_sched_tick(ts, ktime_get(), cpu); #endif } -- 1.7.5.4