Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp770730pxb; Thu, 15 Apr 2021 06:18:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGOwP0ghTlvHht36pJVNHrhrmRenPY2V0Zka3986TwhxUB3Qyqs9rN86JP2QJBvi9B6T86 X-Received: by 2002:a05:6402:4a:: with SMTP id f10mr4121402edu.85.1618492693933; Thu, 15 Apr 2021 06:18:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618492693; cv=none; d=google.com; s=arc-20160816; b=cDjP0fIWFCzOZXvMIK8fijtU/F4KJF2KC5DrYL7xayWt0otvr3wQVNafWG19XULdAm ceTsOu6DmOp4l/YoYRnUwd4+WNumr546a7w+sxQ+oCCEhUqGCHkJTvpe43dCoZo13fyP E4c8yVTaLQDLnR8TKWlxDOQ97iDxb5nCEj47Z9F1APN58Qkkw+Mn3UjBBMxucQCy7ORp ySh79IWuN8tSVXtFoaDpQFAF/N+LixcAjrUOQr1tfor9FyhNT9oLsrxZxjd+uKPapC2x 71GOxJHo+1E9ipphLgxtqF9XD7qllNGRfD8rhO1vFaYvMVJuiCky3AGdZHT04AQZqLLF mAGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NKejnveXNi5sKQ3Fqa03VCfcV7AALd2c36ccz7nhPZY=; b=t29WOI60wy8XHeES6GhccBchJpu8sAGCkaK9yf8+N2AXtUrmnN+oAfcnREcZgrfJV+ ZFLrJ7voaPhhxcZCLHIjlE1V/uP7RS5d5KLuNdg/FSLf3EhF7ybvpVB3mhqmTjxyJJyL sT6AcDieLUFybTvlUsCRNpYzW6rnPztf+kzNhcYzEY7YxWinXvd9Xv/zStUEjpoyvKLV KXKcpZrmjcJsAwk9EcVRCNW+qCTL/gu6whu8vdFlLxme6wfzGPZyndngzb47U129sPcG RrxJdFKJHbnLKDP/v/iHphM8Xc469VKWj79XBbzpMlSzT7dJWmh9ML6ncJJtccnKmvhM rivg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ba6yy8JJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id za11si2158128ejb.272.2021.04.15.06.17.48; Thu, 15 Apr 2021 06:18:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ba6yy8JJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233060AbhDONRE (ORCPT + 99 others); Thu, 15 Apr 2021 09:17:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230202AbhDONRC (ORCPT ); Thu, 15 Apr 2021 09:17:02 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6C8AC061574 for ; Thu, 15 Apr 2021 06:16:39 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id g9so7255905wrx.0 for ; Thu, 15 Apr 2021 06:16:39 -0700 (PDT) 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; bh=NKejnveXNi5sKQ3Fqa03VCfcV7AALd2c36ccz7nhPZY=; b=ba6yy8JJ2NkhGLg2FXH94QCAJwG/HzFyRsAvCFc2WH8bdvAq4Ou7Dj/t+mLuWyHUP5 p83FLHxXC1vkKLcHKmmsqWEy6wjWbGdUzumINwnJMu0myqEoR+EgZRR4E9cQfcLPb1mk qd0kQTif5m9NPRTVER/al96QKXCRNfrOvsDRsZHaE+2H5wEhHkJ6x6nl7LElU/7zjcVx Wk7mNtuZpqoCeVVW3cdE2W3PLIo2j6x7pl2AuPY2CTi6aS/mAk7etwqaf7tRPpSG/BH1 JvtenQM2vmZxjSKSXFV2DYyJJ1Y+/1PcU2VtHdb7chZekR3sjVWsBb9mJKwhQisi0hDh Q1yg== 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; bh=NKejnveXNi5sKQ3Fqa03VCfcV7AALd2c36ccz7nhPZY=; b=cGcFdbvKgw4Wv2V7ygqIPvxj3rZIt1oSS2/phhGNdd0Wkx4fV+lR+FGbpv+VCHfdt3 ddOPwqvcoiHBIenqROO3XJKxejwDAOg14sCIKWCvrBDAg92paJQAldwcxed292NNLSKh 5ONLmW3utDPHC3I7v9r0+/V6/nmj/wgpPZOlpynBNrSFBmek0MHSctqTvGB0/kiq807I gIrtbdbRqmpir7hfGjw4xx0ICDgG48KWI0WIO3Qeh7F0iV0MI5l2+DFtbxE751j0bBgT vg2g2TdsFMlEogRjwqtyo49Glp/FHbz8egcMwYkQCq/DHqrIfi8dvqSdzrspUtLg6SjH 2y/Q== X-Gm-Message-State: AOAM533PcuOv7cr+YQDW8S4FSYLGIC8/cVC7ZUH9pl5HhYhVEpZ2qXgE 2heK45cLhQIpezvN5NcRglJlSw== X-Received: by 2002:adf:eb4a:: with SMTP id u10mr3587905wrn.409.1618492598330; Thu, 15 Apr 2021 06:16:38 -0700 (PDT) Received: from google.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id n9sm3134003wrq.86.2021.04.15.06.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 06:16:38 -0700 (PDT) Date: Thu, 15 Apr 2021 13:16:35 +0000 From: Quentin Perret To: Vincent Donnefort Cc: peterz@infradead.org, rjw@rjwysocki.net, viresh.kumar@linaro.org, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, ionela.voinescu@arm.com, lukasz.luba@arm.com, dietmar.eggemann@arm.com Subject: Re: [PATCH] PM / EM: Inefficient OPPs detection Message-ID: References: <1617901829-381963-1-git-send-email-vincent.donnefort@arm.com> <1617901829-381963-2-git-send-email-vincent.donnefort@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1617901829-381963-2-git-send-email-vincent.donnefort@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 08 Apr 2021 at 18:10:29 (+0100), Vincent Donnefort wrote: > --- a/kernel/sched/cpufreq_schedutil.c > +++ b/kernel/sched/cpufreq_schedutil.c > @@ -10,6 +10,7 @@ > > #include "sched.h" > > +#include > #include > #include > > @@ -164,6 +165,9 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy, > > freq = map_util_freq(util, freq, max); > > + /* Avoid inefficient performance states */ > + freq = em_pd_get_efficient_freq(em_cpu_get(policy->cpu), freq); I remember this was discussed when Douglas sent his patches some time ago, but I still find it sad we index the EM table here but still re-index the cpufreq frequency table later :/ Yes in your case this lookup is very inexpensive, but still. EAS relies on the EM's table matching cpufreq's accurately, so this second lookup still feels rather unnecessary ... > if (freq == sg_policy->cached_raw_freq && !sg_policy->need_freq_update) > return sg_policy->next_freq; > > -- > 2.7.4 >