Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754216AbcKIQyT (ORCPT ); Wed, 9 Nov 2016 11:54:19 -0500 Received: from mail-yw0-f182.google.com ([209.85.161.182]:34929 "EHLO mail-yw0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752065AbcKIQyR (ORCPT ); Wed, 9 Nov 2016 11:54:17 -0500 MIME-Version: 1.0 In-Reply-To: <20161019095350.GH3102@twins.programming.kicks-ass.net> References: <20161010100107.GZ16071@codeblueprint.co.uk> <20161010173440.GA28945@linaro.org> <20161011102453.GA16071@codeblueprint.co.uk> <20161018102937.GI16071@codeblueprint.co.uk> <20161018111017.GY3142@twins.programming.kicks-ass.net> <20161018112957.GJ16071@codeblueprint.co.uk> <20161018121557.GA3142@twins.programming.kicks-ass.net> <20161019095350.GH3102@twins.programming.kicks-ass.net> From: Vincent Guittot Date: Wed, 9 Nov 2016 17:53:56 +0100 Message-ID: Subject: Re: [PATCH] sched/fair: Do not decay new task load on first enqueue To: Peter Zijlstra Cc: Matt Fleming , Wanpeng Li , Ingo Molnar , "linux-kernel@vger.kernel.org" , Mike Galbraith , Yuyang Du , Dietmar Eggemann Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1912 Lines: 59 On 19 October 2016 at 11:53, Peter Zijlstra wrote: > On Wed, Oct 19, 2016 at 08:38:12AM +0200, Vincent Guittot wrote: >> > It might make sense to have helper functions to evaluate those >> >> The main issue is the number of parameters used in these conditions >> that makes helper function not really more readable. > > Fair enough I suppose.. > >> > conditions, because currently there's two instances of each, once in the >> > branch selection and then again (but inverted, we miss the == case fwiw) >> >> not sure to catch the comment about inverted and miss the == case > > Oh, you're right. Which proves my point on this not being entirely > readable :/ Hi Peter, I'm not sure of the status of this patch. It seems difficult to get a more readable code. Do you want me to add more comments about when we enter each state or current version is enough ? Vincent > > Initially I thought the things were of the form: > > else if (ineq) { > } > > ... > > if (... || !ineq || ...) > > > Which would get you things like: ab, and leave a==b > undefined. But if I put them along side one another like: > > > + } else if (min_runnable_load > (runnable_load + imbalance)) { > > + (min_runnable_load > (this_runnable_load + imbalance)) || > > > + } else if ((runnable_load < (min_runnable_load + imbalance)) && > + (100*min_avg_load > sd->imbalance_pct*avg_load)) { > > + ((this_runnable_load < (min_runnable_load + imbalance)) && > + (100*min_avg_load > sd->imbalance_pct*this_avg_load))) > > We can see this is not in fact the case. > > Blergh, I also cannot see a pretty way to increase readability here, > because while they have the same general shape, there's this small > variation with this_*. > > A well..