From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752661AbbCWOqb (ORCPT ); Mon, 23 Mar 2015 10:46:31 -0400 Received: from casper.infradead.org ([85.118.1.10]:56506 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752303AbbCWOqa (ORCPT ); Mon, 23 Mar 2015 10:46:30 -0400 Date: Mon, 23 Mar 2015 15:46:20 +0100 From: Peter Zijlstra To: Morten Rasmussen Cc: mingo@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, yuyang.du@intel.com, preeti@linux.vnet.ibm.com, mturquette@linaro.org, nico@linaro.org, rjw@rjwysocki.net, juri.lelli@arm.com, linux-kernel@vger.kernel.org Subject: Re: [RFCv3 PATCH 12/48] sched: Make usage tracking cpu scale-invariant Message-ID: <20150323144620.GI23123@twins.programming.kicks-ass.net> References: <1423074685-6336-1-git-send-email-morten.rasmussen@arm.com> <1423074685-6336-13-git-send-email-morten.rasmussen@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1423074685-6336-13-git-send-email-morten.rasmussen@arm.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 04, 2015 at 06:30:49PM +0000, Morten Rasmussen wrote: > From: Dietmar Eggemann > > Besides the existing frequency scale-invariance correction factor, apply > cpu scale-invariance correction factor to usage tracking. > > Cpu scale-invariance takes cpu performance deviations due to > micro-architectural differences (i.e. instructions per seconds) between > cpus in HMP systems (e.g. big.LITTLE) and differences in the frequency > value of the highest OPP between cpus in SMP systems into consideration. > > Each segment of the sched_avg::running_avg_sum geometric series is now > scaled by the cpu performance factor too so the > sched_avg::utilization_avg_contrib of each entity will be invariant from > the particular cpu of the HMP/SMP system it is gathered on. > > So the usage level that is returned by get_cpu_usage stays relative to > the max cpu performance of the system. > @@ -2547,6 +2549,10 @@ static __always_inline int __update_entity_runnable_avg(u64 now, int cpu, > > if (runnable) > sa->runnable_avg_sum += scaled_delta_w; > + > + scaled_delta_w *= scale_cpu; > + scaled_delta_w >>= SCHED_CAPACITY_SHIFT; > + > if (running) > sa->running_avg_sum += scaled_delta_w; > sa->avg_period += delta_w; Maybe help remind me why we want this asymmetry between runnable and running in terms of scaling? The above talks about why we want running scaled with the cpu metric, but it forgets to tell me why we do not want to scale runnable. (even if I were to have a vague recollection it seems like a good thing to write down someplace ;-).