Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp594497yba; Thu, 16 May 2019 06:06:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNSXWH80/vO1RlrVKoKLiTkI28yYnZzoK6LTOo90XtA285a2dSbmZdzyAF9G3NdW8NH408 X-Received: by 2002:a63:7141:: with SMTP id b1mr49914188pgn.331.1558011965204; Thu, 16 May 2019 06:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558011965; cv=none; d=google.com; s=arc-20160816; b=gK9OSa0gQFHzt8xGY/N2C5htdS1sEmwCfR62XFfJzJZQ3D9Xszv6BXXYZlCyBotOoj AfrCKKQpk+HdSsS6m94wHRsUegU5NGaZttHK9ZDnpKWAMxFnMLEgtJhaAm2b2hCTqaeX rwAicwXkWZykjzQBzxPbxSvskxkuJ9L3I9gQBBhrvJZG1qYymLbu4JUZ9p1kYC3aivbQ YOVinpSiZuWJf/oy3lqZpj2+smTTEjwFM2NtpRk+Ci15bhNMPFaC1vnAO0b2d9o2dTwf EzPWgXgV9l3ECo/yehDgJk/inbaJmWOhQII6GWseHSIKQOYkiNt3tvqJDD8YH+bs5a3m 3qQw== 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=IECxOBi/DOVV8tFgLQVm/AKBiRewu6vSc+3Xo76TypY=; b=NH86da2j23uMZY7qk2wyUDhr4paNoFbu028Ts3OMfP6e2fw8WUVo64BlzeWXX7n+Zk vXcbZxkEsZztxS3knENR8T9XUsCNjOBP0hSd1eoKlaCPqSPCxtd6l1/OMwhyoC535re+ q+IzSouaIQL1CXGArUGWWO2h+2pU8Gs0EOXhKiP/8M3lsk2aqD+aXoDXv/Ja8k4y5fYj u3hzcDMiHKplvhBk+uaB2rOqdQASB9FSnPvg+8g3ijMuNqovSHlQHUOhzbiJ+GYEiSd7 4FaSNAVUtBH7GYFW+hYOxnG61jSRBbqC6TbJCPmoPUS/MSHlEC6FN2GDT+RNqDwXebXi rZDw== 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 j5si4758992pgq.566.2019.05.16.06.05.47; Thu, 16 May 2019 06:06:05 -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 S1727451AbfEPNCF (ORCPT + 99 others); Thu, 16 May 2019 09:02:05 -0400 Received: from foss.arm.com ([217.140.101.70]:45000 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbfEPNCE (ORCPT ); Thu, 16 May 2019 09:02:04 -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 72BB51715; Thu, 16 May 2019 06:02:04 -0700 (PDT) Received: from queper01-lin (queper01-lin.cambridge.arm.com [10.1.195.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1BD1B3F703; Thu, 16 May 2019 06:02:02 -0700 (PDT) Date: Thu, 16 May 2019 14:01:50 +0100 From: Quentin Perret To: Patrick Bellasi 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: <20190516130148.uhq55ptut47usnae@queper01-lin> References: <20190508174301.4828-1-douglas.raillard@arm.com> <20190508174301.4828-2-douglas.raillard@arm.com> <20190516124200.opxczohjelhvrzmo@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190516124200.opxczohjelhvrzmo@e110439-lin> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. But I agree these hard coded values (that one, and the 512 in one of the following patches) could use some motivation :-) Thanks, Quentin