Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752319AbdDMQNS (ORCPT ); Thu, 13 Apr 2017 12:13:18 -0400 Received: from merlin.infradead.org ([205.233.59.134]:53230 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbdDMQNQ (ORCPT ); Thu, 13 Apr 2017 12:13:16 -0400 Date: Thu, 13 Apr 2017 18:13:07 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: Ingo Molnar , linux-kernel , Dietmar Eggemann , Morten Rasmussen , Yuyang Du , Paul Turner , Ben Segall Subject: Re: [PATCH v2] sched/fair: update scale invariance of PELT Message-ID: <20170413161307.q7g3wtlvh3c76zvp@hirez.programming.kicks-ass.net> References: <1491815909-13345-1-git-send-email-vincent.guittot@linaro.org> <20170410173802.orygigjbcpefqtdv@hirez.programming.kicks-ass.net> <20170411075221.GA30421@linaro.org> <20170413133928.jmykwcq4qq5grktk@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1496 Lines: 36 On Thu, Apr 13, 2017 at 05:16:20PM +0200, Vincent Guittot wrote: > On 13 April 2017 at 15:39, Peter Zijlstra wrote: > > OK, so the reason util_avg varies is because we compute it wrong. And I > > think we can easily fix that once we pull out all the factors (which > > would mean your patch and the pulling out of weight patch which still > > needs to be finished). > > That would be great to remove this unwanted variation. So the problem with the _avg stuff is that we include the d3 segment, that is the unfinished current window. Since we only re-compute the _avg whenever we roll over, the intent already seems to be to only compute it on completed windows. But because 'complicated/expensive', its hard to not include d3 and thus we get the wobble. Once we compute pure running/runnable sums, without extra contrib factors, we can simply subtract our d3 term from sum when doing the division and change the divider to LOAD_AVG_MAX*y, getting the stable _avg over all completed windows. (you could do the same with factors, but then we get to do a bunch of extra multiplications which aren't free). > > > > But you're comparing against util_sum here, that behaves slightly > > different. I think you want 'util_sum >= 1024 * (LOAD_AVG_MAX - 1024)' > > instead. > > yes, the variation happens on the util_sum Well, for util_sum its simple to ignore the current window, which is what the suggested equation does (note that LOAD_AVG_MAX*y == LOAD_AVG_MAX-1024).