Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754777AbaJJOic (ORCPT ); Fri, 10 Oct 2014 10:38:32 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:48004 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754051AbaJJOi2 (ORCPT ); Fri, 10 Oct 2014 10:38:28 -0400 MIME-Version: 1.0 In-Reply-To: <20141009151211.GV10832@worktop.programming.kicks-ass.net> References: <1412684017-16595-1-git-send-email-vincent.guittot@linaro.org> <1412684017-16595-6-git-send-email-vincent.guittot@linaro.org> <20141009113614.GP4750@worktop.programming.kicks-ass.net> <20141009151211.GV10832@worktop.programming.kicks-ass.net> From: Vincent Guittot Date: Fri, 10 Oct 2014 16:38:06 +0200 Message-ID: Subject: Re: [PATCH v7 5/7] sched: get CPU's usage statistic To: Peter Zijlstra Cc: Ingo Molnar , linux-kernel , Preeti U Murthy , Morten Rasmussen , Kamalesh Babulal , Russell King - ARM Linux , LAK , Rik van Riel , Mike Galbraith , Nicolas Pitre , "linaro-kernel@lists.linaro.org" , Daniel Lezcano , Dietmar Eggemann , Paul Turner , Benjamin Segall Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9 October 2014 17:12, Peter Zijlstra 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 + 1; >> > >> > Like Morten I'm confused by that +1 thing. >> >> ok. the goal was to point out the erroneous case where usage is out of >> the range but if it generates confusion, it can remove it > > Well, the fact that you clip makes that point, returning a value outside > of the specified range doesn't. i meant removing the +1 -- 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/