Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755100AbbKMTzH (ORCPT ); Fri, 13 Nov 2015 14:55:07 -0500 Received: from mga01.intel.com ([192.55.52.88]:24041 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754886AbbKMTyF (ORCPT ); Fri, 13 Nov 2015 14:54:05 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,289,1444719600"; d="scan'208";a="684847557" From: Jacob Pan To: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , John Stultz , LKML Cc: Arjan van de Ven , Srinivas Pandruvada , Len Brown , Rafael Wysocki , Eduardo Valentin , Paul Turner , Jacob Pan Subject: [PATCH 2/4] timer: relax tick stop in idle entry Date: Fri, 13 Nov 2015 11:53:05 -0800 Message-Id: <1447444387-23525-3-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447444387-23525-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1447444387-23525-1-git-send-email-jacob.jun.pan@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1086 Lines: 31 Upon entering idle, we can turn off tick if the next timeout is exactly one tick away. Otherwise, we could enter inner idle loop with tick still enabled, without resched set, the tick will continue during idle therefore less optimal in terms of energy savings. Signed-off-by: Jacob Pan --- kernel/time/tick-sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 7c7ec45..bcadaab 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -606,7 +606,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, * restart it proper. */ delta = next_tick - basemono; - if (delta <= (u64)TICK_NSEC) { + if (delta < (u64)TICK_NSEC) { tick.tv64 = 0; if (!ts->tick_stopped) goto out; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/