From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751912AbbJLHzR (ORCPT ); Mon, 12 Oct 2015 03:55:17 -0400 Received: from terminus.zytor.com ([198.137.202.10]:42126 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbbJLHzP (ORCPT ); Mon, 12 Oct 2015 03:55:15 -0400 Date: Mon, 12 Oct 2015 00:54:32 -0700 From: tip-bot for Daniel Bristot de Oliveira Message-ID: Cc: bristot@redhat.com, efault@gmx.de, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, rostedt@goodmis.org, torvalds@linux-foundation.org, peterz@infradead.org, mingo@kernel.org, lgoncalv@redhat.com Reply-To: mingo@kernel.org, lgoncalv@redhat.com, torvalds@linux-foundation.org, peterz@infradead.org, tglx@linutronix.de, rostedt@goodmis.org, linux-kernel@vger.kernel.org, hpa@zytor.com, efault@gmx.de, bristot@redhat.com In-Reply-To: <10fc3705874aef11dbe152a068b591a7be1899b4.1444314899.git.bristot@redhat.com> References: <10fc3705874aef11dbe152a068b591a7be1899b4.1444314899.git.bristot@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/urgent] sched, tracing: Stop/ start critical timings around the idle=poll idle loop Git-Commit-ID: 9babcd7929bc8967ae3bb6093f603b93c2f9958f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9babcd7929bc8967ae3bb6093f603b93c2f9958f Gitweb: http://git.kernel.org/tip/9babcd7929bc8967ae3bb6093f603b93c2f9958f Author: Daniel Bristot de Oliveira AuthorDate: Thu, 8 Oct 2015 15:36:06 -0300 Committer: Ingo Molnar CommitDate: Mon, 12 Oct 2015 09:45:25 +0200 sched, tracing: Stop/start critical timings around the idle=poll idle loop When using idle=poll, the preemptoff tracer is always showing the idle task as the culprit for long latencies. That happens because critical timings are not stopped before idle loop. This patch stops critical timings before entering the idle loop, starting it again after the idle loop. This problem does not affect the irqsoff tracer because interruptions are enabled before entering the idle loop. Signed-off-by: Daniel Bristot de Oliveira Reviewed-by: Luis Claudio R. Goncalves Acked-by: Steven Rostedt Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/10fc3705874aef11dbe152a068b591a7be1899b4.1444314899.git.bristot@redhat.com Signed-off-by: Ingo Molnar --- kernel/sched/idle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index 8f177c7..4a2ef5a 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c @@ -57,9 +57,11 @@ static inline int cpu_idle_poll(void) rcu_idle_enter(); trace_cpu_idle_rcuidle(0, smp_processor_id()); local_irq_enable(); + stop_critical_timings(); while (!tif_need_resched() && (cpu_idle_force_poll || tick_check_broadcast_expired())) cpu_relax(); + start_critical_timings(); trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); rcu_idle_exit(); return 1;