Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753473AbdDMNjh (ORCPT ); Thu, 13 Apr 2017 09:39:37 -0400 Received: from merlin.infradead.org ([205.233.59.134]:51592 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753420AbdDMNje (ORCPT ); Thu, 13 Apr 2017 09:39:34 -0400 Date: Thu, 13 Apr 2017 15:39:28 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, yuyang.du@intel.com, pjt@google.com, bsegall@google.com Subject: Re: [PATCH v2] sched/fair: update scale invariance of PELT Message-ID: <20170413133928.jmykwcq4qq5grktk@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170411075221.GA30421@linaro.org> 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: 1466 Lines: 30 On Tue, Apr 11, 2017 at 09:52:21AM +0200, Vincent Guittot wrote: > > Secondly, what's up with the util_sum < LOAD_AVG_MAX * 1000 thing? > > The lost idle time makes sense only if the task can also be "idle" > when running at max capacity. When util_sum reaches the > LOAD_AVG_MAX*SCHED_CAPACITY_SCALE value, all tasks are considered to > be the same as we can't make any difference between a task running > 400ms or a task running 400sec. It means that these tasks are "always > running" tasks even at max capacity. In this case, there is no lost > idle time as they always run and tracking and adding back the lost > idle time because we run at lower capacity doesn't make sense anymore > so we discard it. Right, this is the point we reached yesterday with the too low F. At that point you cannot know and we assuming u=1, F<1 -> u=1, F=1, which is a sensible assumption. > Then an always running task can have a util_sum that is less than the > max value because of the rounding (util_avg varies between > [1006..1023]), so I use LOAD_AVG_MAX*1000 instead of LOAD_AVG_MAX*1024 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). But you're comparing against util_sum here, that behaves slightly different. I think you want 'util_sum >= 1024 * (LOAD_AVG_MAX - 1024)' instead.