From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755195AbbIHPR2 (ORCPT ); Tue, 8 Sep 2015 11:17:28 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:34742 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754664AbbIHPRZ (ORCPT ); Tue, 8 Sep 2015 11:17:25 -0400 MIME-Version: 1.0 In-Reply-To: <20150908141015.GJ3644@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> <20150908141015.GJ3644@twins.programming.kicks-ass.net> From: Vincent Guittot Date: Tue, 8 Sep 2015 17:17:03 +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 16:10, Peter Zijlstra wrote: > On Tue, Sep 08, 2015 at 03:39:37PM +0200, Vincent Guittot wrote: >> > 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 ? > > Sadly not enough; aside from the fact that we really should do !0 > LOAD_RESOLUTION on 64bit, the whole magic tables (runnable_avg_yN_*[]) > and LOAD_AVG_MAX* values rely on the unit being 1<<10. ah yes, i forgot to take into account the LOAD_RESOLUTION. So after some more thinking, i finally don't see where in the code, we will have a issue if SCHED_CAPACITY_SHIFT is not equal to (SCHED_LOAD_SHIFT - SCHED_LOAD_RESOLUTION) or not equal to 10 with the respect of using a value that doesn't overflow the variables Regards, Vincent > > So regardless of defining one in terms of the other, we should check > both are in fact 10 and error out otherwise. > > Changing them must involve recomputing these numbers or otherwise > mucking about with shifts to ensure its back to 10 when we do this load > muck.