Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757712Ab2EDMUT (ORCPT ); Fri, 4 May 2012 08:20:19 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:35000 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757286Ab2EDMUR convert rfc822-to-8bit (ORCPT ); Fri, 4 May 2012 08:20:17 -0400 MIME-Version: 1.0 In-Reply-To: <20120504120455.GB4413@somewhere.redhat.com> References: <1336056962-10465-1-git-send-email-gilad@benyossef.com> <1336056962-10465-2-git-send-email-gilad@benyossef.com> <20120504120455.GB4413@somewhere.redhat.com> Date: Fri, 4 May 2012 14:20:16 +0200 Message-ID: Subject: Re: [PATCH v1 1/6] timer: make __next_timer_interrupt explicit about no future event From: Frederic Weisbecker To: Gilad Ben-Yossef , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Tejun Heo , John Stultz , Andrew Morton , KOSAKI Motohiro , Mel Gorman , Mike Frysinger , David Rientjes , Hugh Dickins , Minchan Kim , Konstantin Khlebnikov , Christoph Lameter , Chris Metcalf , Hakan Akkan , Max Krasnyansky , linux-mm@kvack.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1441 Lines: 31 2012/5/4 Frederic Weisbecker : > On Thu, May 03, 2012 at 05:55:57PM +0300, Gilad Ben-Yossef wrote: >> @@ -1317,9 +1322,15 @@ unsigned long get_next_timer_interrupt(unsigned long now) >> ? ? ? if (cpu_is_offline(smp_processor_id())) >> ? ? ? ? ? ? ? return now + NEXT_TIMER_MAX_DELTA; >> ? ? ? spin_lock(&base->lock); >> - ? ? if (time_before_eq(base->next_timer, base->timer_jiffies)) >> - ? ? ? ? ? ? base->next_timer = __next_timer_interrupt(base); >> - ? ? expires = base->next_timer; >> + ? ? if (time_before_eq(base->next_timer, base->timer_jiffies)) { >> + >> + ? ? ? ? ? ? if (__next_timer_interrupt(base, &expires)) >> + ? ? ? ? ? ? ? ? ? ? base->next_timer = expires; >> + ? ? ? ? ? ? else >> + ? ? ? ? ? ? ? ? ? ? expires = now + NEXT_TIMER_MAX_DELTA; > > I believe you can update base->next_timer to now + NEXT_TIMER_MAX_DELTA, > so on any further idle interrupt exit that call tick_nohz_stop_sched_tick(), > we won't get again the overhead of __next_timer_interrupt(). Ah forget that, I was confused. If we do that we actually get the useless timer at now + NEXT_TIMER_MAX_DELTA. So I think the patch is fine. Acked-by: Frederic Weisbecker -- 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/