Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3295875pxj; Tue, 1 Jun 2021 01:50:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8TT6fKszTWE9VvQ6Kcaud3UI9FOjYzg2YXp5pP9pURr3u9vLSCaVCWXLWZS4Ha3biUSnz X-Received: by 2002:a17:906:2887:: with SMTP id o7mr29287519ejd.79.1622537450190; Tue, 01 Jun 2021 01:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622537450; cv=none; d=google.com; s=arc-20160816; b=lwh+ryaOQbCVF7FdAd+mZcxCVaXvF3aXMw15B/9ayvBrZNXrt3/P5FQ7Bab14BlTpY PDWIf9gwekBY1K+xNy0ZRImXgsvNmGMcAP55VMt0mSVPfR01zOgOhzz0rnQKQEsutKOj BCTb6sW5iG8nLqa5lKVQY0xDx2GF0KwKkiKeamKSX/qq1K2d/KIoVLMmMKgeiX2qvMCH ASx5+5Y5hdwjChxrf8kCmZJ40rmXadafTA8Y3qvXkS15peIKnln6PhTZmX7tD/VEQ9IN ieIyiDaJpwZqno81BkT7Q/UXq2eFLPUDt6ueBZNhqiPh0EFEwMzp3YItJ99RTaj6M1ha b96Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=OES8qRxHj4RZ/OPCLC5MXHd7Qq93tSWcvkh9gaW61+Y=; b=kAFmOqdRPn4e6Zy99HuvOL1P/lRYnwP+AK2MUkD43QbGeEUIVc9h+HcuP7XMNXSIx0 TmTnUOysbxX98XY2Lob1062Xn7HdjJq0oFY6aEq+yX59kngMmEiNStFLBLk/Vv6NuyUe L+vgeXEUc6X5HDyVMIUXRK79t3gfpXu6lYSIC8XKa+6joJF+i2XJ8gIkFzA66FwagiVD Gq1BeJKfCQ5cuNfiTk+5OpNUPTG+WzcSQKOMS/H2QaHn2MvyXLnzykzBDOP83qCL4WNE htW4j96eEglR0lYLRbfunJzfVKi7BLj7+ryaTZ7xrmBGynodDNg9+JjwHHKut26jGgRT BPJQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f25si17665640ejh.388.2021.06.01.01.50.27; Tue, 01 Jun 2021 01:50:50 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233465AbhFAItV (ORCPT + 99 others); Tue, 1 Jun 2021 04:49:21 -0400 Received: from foss.arm.com ([217.140.110.172]:43640 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233680AbhFAItR (ORCPT ); Tue, 1 Jun 2021 04:49:17 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 93F731FB; Tue, 1 Jun 2021 01:47:36 -0700 (PDT) Received: from e120877-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CADA3F73D; Tue, 1 Jun 2021 01:47:35 -0700 (PDT) Date: Tue, 1 Jun 2021 09:47:25 +0100 From: Vincent Donnefort To: Viresh Kumar Cc: Peter Zijlstra , rjw@rjwysocki.net, vincent.guittot@linaro.org, qperret@google.com, linux-kernel@vger.kernel.org, ionela.voinescu@arm.com, lukasz.luba@arm.com, dietmar.eggemann@arm.com Subject: Re: [PATCH v2 3/3] PM / EM: Skip inefficient OPPs Message-ID: <20210601084725.GA223449@e120877-lin.cambridge.arm.com> References: <1621616064-340235-1-git-send-email-vincent.donnefort@arm.com> <1621616064-340235-4-git-send-email-vincent.donnefort@arm.com> <20210528050934.muji5bv7ed4k4t6j@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210528050934.muji5bv7ed4k4t6j@vireshk-i7> User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28, 2021 at 10:39:34AM +0530, Viresh Kumar wrote: > On 25-05-21, 10:48, Peter Zijlstra wrote: > > On Fri, May 21, 2021 at 05:54:24PM +0100, Vincent Donnefort wrote: > > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > > > index 4f09afd..5a91a2b 100644 > > > --- a/kernel/sched/cpufreq_schedutil.c > > > +++ b/kernel/sched/cpufreq_schedutil.c > > > @@ -10,6 +10,7 @@ > > > > > > #include "sched.h" > > > > > > +#include > > > #include > > > #include > > > > > > @@ -153,6 +154,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); > > > + > > > if (freq == sg_policy->cached_raw_freq && !sg_policy->need_freq_update) > > > return sg_policy->next_freq; > > > > > > > This seems somewhat unfortunate, it adds a loop over the OPPs only to > > then call into cpufreq to do the exact same thing again :/ > > And that's why I feel it needs to be done at a single place, either disable the > OPP (which seems like a bad option based on what Lukasz and Vincent said > earlier), or make changes in the cpufreq core itself to search for the best > frequency (like adding another API to mark some frequencies as inefficient, and > take that into account while selecting next freq). > > There is a potential of ending up selecting the wrong frequency here because > there are too many decision making bodies here and so corner cases. > > -- > viresh Hi Viresh, Seems like no one has been really convinced about the arguments in favor of keeping inefficiencies into EM :) Let me then give a shot with marking the OPPs for the next version. -- Vincent