Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp618451yba; Thu, 16 May 2019 06:26:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiBgBuwYHJ0BtNirgR3p087UWG5lM7ZwMe4bHdpW633BCvkxwfJxTVZeX9yQQ4DMELtPFY X-Received: by 2002:a17:902:2924:: with SMTP id g33mr23649596plb.57.1558013173853; Thu, 16 May 2019 06:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558013173; cv=none; d=google.com; s=arc-20160816; b=lMoCyAU9lCLMaR4RZnljNmWkT/7Ew6X3R/GWJBVcksOUk6QCRSCIDfY9eCUZqSbM94 fBcwLt4WnqBNhYxiXHf2voAdQAfbQMLebZA+Oo8X2BHbAKuSzawZmcSciTNvrx68jV0b /0/Sg5d4UxxwMfHKg0MIN1jaKsFd+WvEc0Q9AV35Nwrdt4givfkYNaKibuMafPFDE1Mw pzmp+IpgXphi7wCBFsB1E8lXIYnf75EjZYorpL/tsvJ4HMP8hamHkT5QIooM3H+lTBmS W+tD1tDVmmCHz5aFFG4fw5WpAJjBDfOHjs2q5FIk7B9LQ0/NIMTVGklRz3F3vKezAcHj lAhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=XmB3ixf349Yx1FwWHtHZG8vb1bs1wRH++1nF21hFsgg=; b=LpnVwCp4B9YRIMI88CzwNDkAMb1I176m8j3CUHzvDOZNzBR7W1cAJLzTldlE2nlzYk cE/4FcK6QfRJ40mGHOoeEAajB0QyujbDSadSZVI6+b7Le6LskOT6IN1fmTm9SDm5kxXf jSmNdoGzW0Bg9HKqT4UzLWsYOgcyPPDDGQkxTPzEhmu2GrDv80vrDp404sdwmh3bZIml 8APBPcb4J0PImfBpRzf2HhbB8UcueJnVR2RC9bnt8yU/60+EDwl7pWL6eUK8rkHf2dSN gTwcclTQKAdLx1mYgQqNx5Q4uKSmKpJo76bD5sa3Qtp2MRmjJwLWZ3E47w0Gl9ge9hxt 3esw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u21si242625pga.151.2019.05.16.06.25.59; Thu, 16 May 2019 06:26:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727696AbfEPNWz (ORCPT + 99 others); Thu, 16 May 2019 09:22:55 -0400 Received: from foss.arm.com ([217.140.101.70]:45662 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726955AbfEPNWy (ORCPT ); Thu, 16 May 2019 09:22:54 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 708481715; Thu, 16 May 2019 06:22:54 -0700 (PDT) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1A0F53F703; Thu, 16 May 2019 06:22:52 -0700 (PDT) Date: Thu, 16 May 2019 14:22:50 +0100 From: Patrick Bellasi To: Quentin Perret Cc: douglas.raillard@arm.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, dietmar.eggemann@arm.com Subject: Re: [RFC PATCH 1/7] PM: Introduce em_pd_get_higher_freq() Message-ID: <20190516132250.hedtianse7rnk3wq@e110439-lin> References: <20190508174301.4828-1-douglas.raillard@arm.com> <20190508174301.4828-2-douglas.raillard@arm.com> <20190516124200.opxczohjelhvrzmo@e110439-lin> <20190516130148.uhq55ptut47usnae@queper01-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190516130148.uhq55ptut47usnae@queper01-lin> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16-May 14:01, Quentin Perret wrote: > On Thursday 16 May 2019 at 13:42:00 (+0100), Patrick Bellasi wrote: > > > +static inline unsigned long em_pd_get_higher_freq(struct em_perf_domain *pd, > > > + unsigned long min_freq, unsigned long cost_margin) > > > +{ > > > + unsigned long max_cost = 0; > > > + struct em_cap_state *cs; > > > + int i; > > > + > > > + if (!pd) > > > + return min_freq; > > > + > > > + /* Compute the maximum allowed cost */ > > > + for (i = 0; i < pd->nr_cap_states; i++) { > > > + cs = &pd->table[i]; > > > + if (cs->frequency >= min_freq) { > > > + max_cost = cs->cost + (cs->cost * cost_margin) / 1024; > > ^^^^ > > ... end here we should probably better use SCHED_CAPACITY_SCALE > > instead of hard-coding in values, isn't it? > > I'm not sure to agree. This isn't part of the scheduler per se, and the > cost thing isn't in units of capacity, but in units of power, so I don't > think SCHED_CAPACITY_SCALE is correct here. Right, I get the units do not match and it would not be elegant to use it here... > But I agree these hard coded values (that one, and the 512 in one of the > following patches) could use some motivation :-) ... ultimately SCHED_CAPACITY_SCALE is just SCHED_FIXEDPOINT_SCALE, which is adimensional. Perhaps we should use that or yet another alias for the same. > Thanks, > Quentin -- #include Patrick Bellasi