From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754189AbbKBQKb (ORCPT ); Mon, 2 Nov 2015 11:10:31 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:43595 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751965AbbKBQKX (ORCPT ); Mon, 2 Nov 2015 11:10:23 -0500 Date: Mon, 2 Nov 2015 17:10:16 +0100 From: Peter Zijlstra To: byungchul.park@lge.com Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, tglx@linutronix.de Subject: Re: [PATCH v4 2/2] sched: consider missed ticks in full NOHZ Message-ID: <20151102161016.GS3604@twins.programming.kicks-ass.net> References: <1444816056-11886-1-git-send-email-byungchul.park@lge.com> <1444816056-11886-3-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1444816056-11886-3-git-send-email-byungchul.park@lge.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 14, 2015 at 06:47:36PM +0900, byungchul.park@lge.com wrote: > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -4428,7 +4428,7 @@ static void update_idle_cpu_load(struct rq *this_rq) So if one were to read the comment above update_idle_cpu_load() one would find there's a problem with jiffy based accounting. > /* > * Called from tick_nohz_idle_exit() -- try and fix up the ticks we missed. > */ > -void update_cpu_load_nohz(void) > +void update_cpu_load_nohz(int active) > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c > index 7c7ec45..515edf3 100644 > --- a/kernel/time/tick-sched.c > +++ b/kernel/time/tick-sched.c > -static void tick_nohz_restart_sched_tick(struct tick_sched *ts, ktime_t now) > +static void tick_nohz_restart_sched_tick(struct tick_sched *ts, ktime_t now, int active) > { > /* Update jiffies first */ > tick_do_update_jiffies64(now); > - update_cpu_load_nohz(); > + update_cpu_load_nohz(active); > > calc_load_exit_idle(); > touch_softlockup_watchdog(); And we could solve all that nicely if we pull up the hrtimer_forward() result from tick_nohz_restart(), that way we have the actual number of ticks lost on this cpu, and no need to start guessing about it. Hmm?