From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751568AbbJEKwQ (ORCPT ); Mon, 5 Oct 2015 06:52:16 -0400 Received: from casper.infradead.org ([85.118.1.10]:57988 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750848AbbJEKwN (ORCPT ); Mon, 5 Oct 2015 06:52:13 -0400 Date: Mon, 5 Oct 2015 12:52:09 +0200 From: Peter Zijlstra To: Yuyang Du Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, pjt@google.com, bsegall@google.com, morten.rasmussen@arm.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com Subject: Re: [PATCH 1/4] sched/fair: Generalize the load/util averages resolution definition Message-ID: <20151005105209.GG2903@worktop.programming.kicks-ass.net> References: <1443981419-16665-1-git-send-email-yuyang.du@intel.com> <1443981419-16665-2-git-send-email-yuyang.du@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443981419-16665-2-git-send-email-yuyang.du@intel.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 05, 2015 at 01:56:56AM +0800, Yuyang Du wrote: > Metric needs certain resolution to allow detail we can look into, > which also determines the range of the metric. > > For instance, increasing the resolution of [0, 1] (two levels), one > can multiply 1024 and get [0..1024] (1025 levels). > > /* > + * Integer metrics need certain resolution to allow how much detail we > + * can look into, e.g., load, load_avg, util_avg, freq, and capacity. > + * We define a basic resolution constant number, and then formalize > + * all these metrics based on that basic resolution. > + */ > +# define SCHED_RESOLUTION_SHIFT 10 > +# define SCHED_RESOLUTION_SCALE (1L << SCHED_RESOLUTION_SHIFT) > + > +/* I find all that most confusing, maybe just refer to fixed point arithmetic, that's a well defined and well understood concept.