Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753142AbaFDNJ3 (ORCPT ); Wed, 4 Jun 2014 09:09:29 -0400 Received: from fw-tnat.austin.arm.com ([217.140.110.23]:40185 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752870AbaFDNJ2 (ORCPT ); Wed, 4 Jun 2014 09:09:28 -0400 Date: Wed, 4 Jun 2014 14:09:18 +0100 From: Morten Rasmussen To: Vincent Guittot Cc: Peter Zijlstra , "mingo@kernel.org" , "linux-kernel@vger.kernel.org" , "linux@arm.linux.org.uk" , "linux-arm-kernel@lists.infradead.org" , "preeti@linux.vnet.ibm.com" , "efault@gmx.de" , "nicolas.pitre@linaro.org" , "linaro-kernel@lists.linaro.org" , "daniel.lezcano@linaro.org" Subject: Re: [PATCH v2 08/11] sched: get CPU's activity statistic Message-ID: <20140604130918.GO29593@e103034-lin> References: <20140528154703.GJ19967@e103034-lin> <20140603155007.GZ30445@twins.programming.kicks-ass.net> <20140604080809.GK30445@twins.programming.kicks-ass.net> <20140604101724.GD11096@twins.programming.kicks-ass.net> <20140604103619.GL29593@e103034-lin> <20140604112342.GN29593@e103034-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 04, 2014 at 12:52:46PM +0100, Vincent Guittot wrote: > On 4 June 2014 13:23, Morten Rasmussen wrote: > > I get: > > > > A: 15/40 ms = 37.5% > > B: 20/40 ms = 50% > > > > Schedule: > > > > | 5 ms | 5 ms | 5 ms | 5 ms | 5 ms | 5 ms | 5 ms | 5 ms | 5 ms | > > A: run rq run ----------- sleeping ------------- run > > B: rq run rq run ---- sleeping ------------- rq > > > >> and CPU runnable will be 60% too > > > > rq->avg.runnable_avg_sum should be 50%. You have two tasks running for > > 20 ms every 40 ms. > > > > Right? > > ok, i see the misunderstood. > it's depends of what we mean by runnable. You take the % of time > whereas i take the runnable_avg_sum/period Right. There is a difference. > > so A is on_rq 15/40 ms = 37.5% of the time which gives a > runnable_avg_sum/runnable_avg_period of 47% > B is on_rq 20/40 ms = 50% of the time which gives a > runnable_avg_sum/runnable_avg_period of 60% > and CPU has a task on its rq 20/40ms = 50% of the time which gives a > runnable_avg_sum/runnable_avg_period of 60% Yes, that seems about right. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/