From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754775AbbIHNkE (ORCPT ); Tue, 8 Sep 2015 09:40:04 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:34714 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753551AbbIHNj7 (ORCPT ); Tue, 8 Sep 2015 09:39:59 -0400 MIME-Version: 1.0 In-Reply-To: <20150908122606.GH3644@twins.programming.kicks-ass.net> References: <1439569394-11974-1-git-send-email-morten.rasmussen@arm.com> <1439569394-11974-6-git-send-email-morten.rasmussen@arm.com> <55E8DD00.2030706@linaro.org> <55EDAF43.30500@arm.com> <55EDDD5A.70904@arm.com> <20150908122606.GH3644@twins.programming.kicks-ass.net> From: Vincent Guittot Date: Tue, 8 Sep 2015 15:39:37 +0200 Message-ID: Subject: Re: [PATCH 5/6] sched/fair: Get rid of scaling utilization by capacity_orig To: Peter Zijlstra Cc: Dietmar Eggemann , Steve Muckle , Morten Rasmussen , "mingo@redhat.com" , "daniel.lezcano@linaro.org" , "yuyang.du@intel.com" , "mturquette@baylibre.com" , "rjw@rjwysocki.net" , Juri Lelli , "sgurrappadi@nvidia.com" , "pang.xunlei@zte.com.cn" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8 September 2015 at 14:26, Peter Zijlstra wrote: > On Tue, Sep 08, 2015 at 09:22:05AM +0200, Vincent Guittot wrote: >> No, but >> sa->util_avg = (sa->util_sum << SCHED_CAPACITY_SHIFT) / LOAD_AVG_MAX; >> will fix the unit issue. > > Tricky that, LOAD_AVG_MAX very much relies on the unit being 1<<10. > > And where load_sum already gets a factor 1024 from the weight > multiplication, util_sum does not get such a factor, and all the scaling > we do on it loose bits. fair point > > So at the moment we go compute the util_avg value, we need to inflate > util_sum with an extra factor 1024 in order to make it work. > > And seeing that we do the shift up on sa->util_sum without consideration > of overflow, would it not make sense to add that factor before the > scaling and into the addition? Yes this should save 1 left shift and 1 right shift >> > > Now, given all that, units are a complete mess here, and I'd not mind > something like: > > #if (SCHED_LOAD_SHIFT - SCHED_LOAD_RESOLUTION) != SCHED_CAPACITY_SHIFT > #error "something usefull" > #endif In this case why not simply doing #define SCHED_CAPACITY_SHIFT SCHED_LOAD_SHIFT or the opposite ? > > somewhere near here. > >