From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752102AbbJZQhR (ORCPT ); Mon, 26 Oct 2015 12:37:17 -0400 Received: from mga09.intel.com ([134.134.136.24]:6238 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750859AbbJZQhP (ORCPT ); Mon, 26 Oct 2015 12:37:15 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,201,1444719600"; d="scan'208";a="672039777" Date: Mon, 26 Oct 2015 09:26:24 -0700 From: Yunhong Jiang To: Viresh Kumar Cc: Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer. Message-ID: <20151026162624.GA24041@jnakajim-build> References: <1443466096-31252-1-git-send-email-yunhong.jiang@linux.intel.com> <20151020224751.GB31289@jnakajim-build> <20151021104631.GB7784@ubuntu> <20151022214003.GA22993@jnakajim-build> <20151023021951.GP3897@ubuntu> <20151023221015.GA20818@jnakajim-build> <20151024032054.GC16569@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151024032054.GC16569@ubuntu> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 24, 2015 at 08:50:54AM +0530, Viresh Kumar wrote: > On 23-10-15, 15:10, Yunhong Jiang wrote: > > I got this impression from Frederic's comments on > > http://marc.info/?l=linux-kernel&m=139048415303210&w=2, "So you simply rely > > on the next tick to see the new timer. This should work with > > CONFIG_NO_HZ_IDLE but not with CONFIG_NO_HZ_FULL since the target may be > > running without the tick". > > Per my understanding of this comment, it means we can rely on the next tick > > for CONFIG_NO_HZ_IDLE, which means it's sure a tick will happen for > > CONFIG_NO_HZ_IDLE, am I right? > > Yeah, the CPU wouldn't like in idle for ever but the time is not known > and it can be really really long. > > > Hmm, per http://lxr.free-electrons.com/source/include/linux/timer.h#L51, the > > deferreable timer will be serviced when the CPU eventually wakes up "with a > > subsequent non-deferrable timer". > > It will be an IPI mostly.. > > > If there is no non-deferrable timer, based > > on Frederic's comments, we in fact depends on next tick. > > So, the cpu will wake up when it receives an IPI. The first thing we > do then is to restart the tick and we will then service all the > pending deferred timers. > > > My confusion is, why we are sure there is next tick on CONFIG_NO_HZ_IDLE > > idle processor to wake it up. If there is no tick, and no other timer, will > > the timer get no chance to be waken up at all? I don't think "deferred for > > ever" is deferreable. > > There are many kind of works we may want to do. If its really > important to be done earlier, then it should be serviced with a timer. > > deferred timers are better used for activities, which are irrelevant > once the CPU is idle. One case is doing some per-cpu load tracking for > cpufreq governors or the work that vmstat does. > > Even if the CPU wakes up after few hours (hypothetically), it > shouldn't matter. Viresh, thanks for the clarification. So seems the original patch is correct to wakeup the full dyntick CPU even for deferred timer. Thomas/Fred, your idea? Thanks --jyh > > -- > viresh > -- > 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/