From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754523AbcASNF0 (ORCPT ); Tue, 19 Jan 2016 08:05:26 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:35841 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754462AbcASNFR (ORCPT ); Tue, 19 Jan 2016 08:05:17 -0500 Date: Tue, 19 Jan 2016 14:04:57 +0100 From: Peter Zijlstra To: Dietmar Eggemann Cc: Byungchul Park , perterz@infradead.org, Frederic Weisbecker , LKML , Chris Metcalf , Thomas Gleixner , Luiz Capitulino , Christoph Lameter , "Paul E . McKenney" , Mike Galbraith , Rik van Riel Subject: Re: [RFC PATCH 0/4] sched: Improve cpu load accounting with nohz Message-ID: <20160119130457.GB6344@twins.programming.kicks-ass.net> References: <1452700891-21807-1-git-send-email-fweisbec@gmail.com> <569810C4.7090900@arm.com> <20160114212704.GJ6357@twins.programming.kicks-ass.net> <56981FF2.6030700@arm.com> <20160115070749.GA1914@X58A-UD3R> <569924C4.8010903@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <569924C4.8010903@arm.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 Fri, Jan 15, 2016 at 04:56:36PM +0000, Dietmar Eggemann wrote: > Couldn't we set tickless_load only in case: > > unsigned long tickless_load = (active && pending_updates > 1) ? > this_rq->cpu_load[0] : 0; > > Even though update_cpu_load_nohz() can call with pending_updates=1 and > active=1 but then we don't have to decay. decay_load_missed() has an early bail for !missed, which will be tickled with pending_updates == 1. What I was thinking of doing however is: --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4445,13 +4445,15 @@ static void __update_cpu_load(struct rq old_load = this_rq->cpu_load[i]; old_load = decay_load_missed(old_load, pending_updates - 1, i); - old_load -= decay_load_missed(tickless_load, pending_updates - 1, i); - /* - * old_load can never be a negative value because a decayed - * tickless_load cannot be greater than the original - * tickless_load. - */ - old_load += tickless_load; + if (tickless_load) { + old_load -= decay_load_missed(tickless_load, pending_updates - 1, i); + /* + * old_load can never be a negative value because a + * decayed tickless_load cannot be greater than the + * original tickless_load. + */ + old_load += tickless_load; + } new_load = this_load; /* * Round up the averaging division if load is increasing. This Since regardless of the pending_updates, none of that makes sense if !tickless_load.