Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp818873ybl; Thu, 23 Jan 2020 08:18:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwNJhsTjYwSiScpvzMfDvpcX4+OtwhlEVk3MOvscymTvBUiacAlqBFo+Qr2NPBBvzD4wdLB X-Received: by 2002:a05:6808:319:: with SMTP id i25mr11347493oie.128.1579796307925; Thu, 23 Jan 2020 08:18:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579796307; cv=none; d=google.com; s=arc-20160816; b=uRR0iEYDMIckX+K0yffGeXJ/p9l8pKszJtxyAaEAOwkDY+vrLQTDdNNvVQhaRSl4mj Vo6o3d26nNSHmlv2r0zQzxeZ/1MIKIhblLEkD8hyh8BZer8caqo9uFYbhZ87ijxcztTi jMOO8DXMDJ+A3Pb9iyHe3T5GnjHtkfUbSP/N5gt4+rgnFFPG+z90pH8yXwWzVVgrAuW2 yAIXgfbswS/ijhELeHvXE3nozdHT4x9tAODV2U1wxV3iNZSoBf2ULp+ebeONrlOukeZn qQgXUyfc+MmML1hUGwebGq068t2SN6V4tN/6JkKc174CYLn1AlvVyUYULjT+TgYRcZAs XJAg== 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:dkim-signature; bh=3wg8gOrVYdMUWA9+fse4PsjZpTdzVA7/z9UyxnCJfNQ=; b=C3rvPNw4aITkb+UkraWBsfszahI+vm87PfY3wpmCsMSv+D8y1ebkaK62o/z6XxtDzg HWp1+Zm8Okz0mDMltEXCxR9QcEK7H/5fCn+B5goYgbQp72KxK3niUxhpcyxRd9pJERp+ bkQMU349bPa71wjo5sBh5ZTIYt6nivbtUjtwGU/rTel7y88avfjITwhe02sIRp8aUiXP EfSHPUjLku99wa5XhqAjKTXG0dPabrFEAXBtfDqvapYThSud+ngSgFR71Qq3pwqcb1T4 7x51yKtEWdQsJM0x0TefUxsYSGbc3oalyq3MS1kP7hv6/+PtNFZI2Tq6o8j1UavfMjqT Zrlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Cb38uIUJ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n7si1218150otk.277.2020.01.23.08.18.15; Thu, 23 Jan 2020 08:18:27 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=Cb38uIUJ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729009AbgAWQQv (ORCPT + 99 others); Thu, 23 Jan 2020 11:16:51 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36098 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726584AbgAWQQu (ORCPT ); Thu, 23 Jan 2020 11:16:50 -0500 Received: by mail-wr1-f65.google.com with SMTP id z3so3755673wru.3 for ; Thu, 23 Jan 2020 08:16:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3wg8gOrVYdMUWA9+fse4PsjZpTdzVA7/z9UyxnCJfNQ=; b=Cb38uIUJp0jMTwJ0E5yH8vzy5T9Soz0UlHK1JVnva3ss9OdTf61o7IFGnH+pxHfR67 jST75Xd0oFFEJjatfLTXktSTyflyn+b4K7OlFPABTdBOhgTs3UcCOSKb27Vz8l1MdZ0c /Bdp8cbOVevZetkKDvtQSKElHsQKwGX9EojAAsuvDtEbPlw7F9onNHg9ZrPZSNlHaqdL 50keozoLuBTRC0Yyq6rnMYwv3HXMztrhqK0TLZV0Vr5UwW9eOWzFwoHHLehoikHsp09r 9MkAozLrDW8NvDcCclSWiu34RUJgpXLYgElAsAzSfsTo5ycsLdmF5+JVrFaLqNxoMxFX BfJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3wg8gOrVYdMUWA9+fse4PsjZpTdzVA7/z9UyxnCJfNQ=; b=LaWhxSDRA8DphKAiRIWna+zqcHuJe7UoL/otUDVwvdK2pwm+nTQUL1WzN1aW77gzdk Lc4R2yTTUfwlpQxLtBmV0dJ8nb70FyDIXhSTDWVjw29rfKrm0ZSEn+Jw/lt7KLnvwpq1 ghVqqauVdREGJUVrgtlii2snd+HRtYl+Ixu9KvFHccLwj39zLZviuv9c7WKBRErd0P2m LiQnyGPETegqFnMF4jSCtzt/+7tMHqrAS5v8NU+MqMdrc4bjA/mIJmqqoIxQYX8A7kFP F8NSBxI+3smaVfLeviUG4MJBrZRDjeN/lADcdKPS24BnKOI8lvYqbc+9PsWFRpDeDG7y LXPg== X-Gm-Message-State: APjAAAUv/Pf6hELe2hrZ9ypFtLq/wiD0qkTFkPOw2dOG8LhesL6OXUq2 jnb6ayeV6EnYkMpumrx7KJyG4g== X-Received: by 2002:a5d:538e:: with SMTP id d14mr19015715wrv.358.1579796208751; Thu, 23 Jan 2020 08:16:48 -0800 (PST) Received: from google.com ([2a00:79e0:d:110:d6cc:2030:37c1:9964]) by smtp.gmail.com with ESMTPSA id a132sm3254265wme.3.2020.01.23.08.16.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 08:16:48 -0800 (PST) Date: Thu, 23 Jan 2020 16:16:44 +0000 From: Quentin Perret To: Douglas RAILLARD Cc: linux-kernel@vger.kernel.org, rjw@rjwysocki.net, viresh.kumar@linaro.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, linux-pm@vger.kernel.org Subject: Re: [RFC PATCH v4 3/6] sched/cpufreq: Hook em_pd_get_higher_power() into get_next_freq() Message-ID: <20200123161644.GA144523@google.com> References: <20200122173538.1142069-1-douglas.raillard@arm.com> <20200122173538.1142069-4-douglas.raillard@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200122173538.1142069-4-douglas.raillard@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 22 Jan 2020 at 17:35:35 (+0000), Douglas RAILLARD wrote: > @@ -210,9 +211,16 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy, > struct cpufreq_policy *policy = sg_policy->policy; > unsigned int freq = arch_scale_freq_invariant() ? > policy->cpuinfo.max_freq : policy->cur; > + struct em_perf_domain *pd = sugov_policy_get_pd(sg_policy); > > freq = map_util_freq(util, freq, max); > > + /* > + * Try to get a higher frequency if one is available, given the extra > + * power we are ready to spend. > + */ > + freq = em_pd_get_higher_freq(pd, freq, 0); I find it sad that the call just below to cpufreq_driver_resolve_freq() and cpufreq_frequency_table_target() iterates the OPPs all over again. It's especially a shame since most existing users of the EM stuff do have a cpufreq frequency table. Have you looked at hooking this inside cpufreq_driver_resolve_freq() instead ? If we have a well-formed EM available, the call to cpufreq_frequency_table_target() feels redundant, so we might want to skip it. Thoughts ? Quentin