From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753290AbcGSLwR (ORCPT ); Tue, 19 Jul 2016 07:52:17 -0400 Received: from terminus.zytor.com ([198.137.202.10]:52496 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752995AbcGSLwP (ORCPT ); Tue, 19 Jul 2016 07:52:15 -0400 Date: Tue, 19 Jul 2016 04:51:53 -0700 From: tip-bot for Gaurav Jindal Message-ID: Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, gaurav.jindal@spreadtrum.com, hpa@zytor.com, Gaurav.Jindal@spreadtrum.com, sanjeev.yadav@spreadtrum.com, tglx@linutronix.de Reply-To: linux-kernel@vger.kernel.org, mingo@kernel.org, Gaurav.Jindal@spreadtrum.com, hpa@zytor.com, gaurav.jindal@spreadtrum.com, sanjeev.yadav@spreadtrum.com, tglx@linutronix.de In-Reply-To: <20160714120416.GB21099@gaurav.jindal@spreadtrum.com> References: <20160714120416.GB21099@gaurav.jindal@spreadtrum.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/core] tick/nohz: Optimize nohz idle enter Git-Commit-ID: 1f3b0f8243cb934307f59bd4d8e43b868e61d4d9 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: 1f3b0f8243cb934307f59bd4d8e43b868e61d4d9 Gitweb: http://git.kernel.org/tip/1f3b0f8243cb934307f59bd4d8e43b868e61d4d9 Author: Gaurav Jindal AuthorDate: Thu, 14 Jul 2016 12:04:20 +0000 Committer: Thomas Gleixner CommitDate: Tue, 19 Jul 2016 13:48:24 +0200 tick/nohz: Optimize nohz idle enter tick_nohz_start_idle is called before checking whether the idle tick can be stopped. If the tick cannot be stopped, calling tick_nohz_start_idle() is pointless and just wasting CPU cycles. Only invoke tick_nohz_start_idle() when can_stop_idle_tick() returns true. A short one minute observation of the effect on ARM64 shows a reduction of calls by 1.5% thus optimizing the idle entry sequence. [tglx: Massaged changelog ] Co-developed-by: Sanjeev Yadav Signed-off-by: Gaurav Jindal Link: http://lkml.kernel.org/r/20160714120416.GB21099@gaurav.jindal@spreadtrum.com Signed-off-by: Thomas Gleixner --- kernel/time/tick-sched.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 2ec7c00..204fdc8 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -908,11 +908,10 @@ static void __tick_nohz_idle_enter(struct tick_sched *ts) ktime_t now, expires; int cpu = smp_processor_id(); - now = tick_nohz_start_idle(ts); - if (can_stop_idle_tick(cpu, ts)) { int was_stopped = ts->tick_stopped; + now = tick_nohz_start_idle(ts); ts->idle_calls++; expires = tick_nohz_stop_sched_tick(ts, now, cpu);