From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753492AbbDADWn (ORCPT ); Tue, 31 Mar 2015 23:22:43 -0400 Received: from mail-ig0-f174.google.com ([209.85.213.174]:36650 "EHLO mail-ig0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753458AbbDADWm (ORCPT ); Tue, 31 Mar 2015 23:22:42 -0400 MIME-Version: 1.0 In-Reply-To: References: <1425052454-25797-1-git-send-email-vincent.guittot@linaro.org> <1425052454-25797-8-git-send-email-vincent.guittot@linaro.org> Date: Wed, 1 Apr 2015 11:22:41 +0800 Message-ID: Subject: Re: [PATCH v10 07/11] sched: get CPU's usage statistic From: Xunlei Pang To: Vincent Guittot Cc: Peter Zijlstra , Ingo Molnar , lkml , Preeti U Murthy , Morten Rasmussen , Kamalesh Babulal , Rik van Riel , Linaro Kernel Mailman List , Mike Galbraith , Dietmar Eggemann Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vincent, On 27 March 2015 at 23:37, Vincent Guittot wrote: > On 27 March 2015 at 16:12, Xunlei Pang wrote: >>> +static int get_cpu_usage(int cpu) >>> +{ >>> + unsigned long usage = cpu_rq(cpu)->cfs.utilization_load_avg; >>> + unsigned long capacity = capacity_orig_of(cpu); >>> + >>> + if (usage >= SCHED_LOAD_SCALE) >>> + return capacity; >> >> Can "capacity" be greater than SCHED_LOAD_SCALE? >> Why use SCHED_LOAD_SCALE instead of "capacity" in this judgement? > > Yes, SCHED_LOAD_SCALE is the default value but the capacity can be in > the range [1536:512] for arm as an example Right, I was confused between cpu capacity and arch_scale_freq_capacity() in "Patch 04" then. Thanks. -Xunlei