From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1A79C433F5 for ; Mon, 6 Sep 2021 08:17:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9301B60F45 for ; Mon, 6 Sep 2021 08:17:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240039AbhIFISr (ORCPT ); Mon, 6 Sep 2021 04:18:47 -0400 Received: from foss.arm.com ([217.140.110.172]:53380 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239780AbhIFISq (ORCPT ); Mon, 6 Sep 2021 04:18:46 -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 09478D6E; Mon, 6 Sep 2021 01:17:42 -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 917373F73D; Mon, 6 Sep 2021 01:17:40 -0700 (PDT) Date: Mon, 6 Sep 2021 09:17:34 +0100 From: Vincent Donnefort To: "Rafael J. Wysocki" Cc: Peter Zijlstra , "Rafael J. Wysocki" , Viresh Kumar , Vincent Guittot , Quentin Perret , Linux PM , Ionela Voinescu , Lukasz Luba , Dietmar Eggemann , Matthias Kaehlcke Subject: Re: [PATCH v6 6/7] cpufreq: Skip inefficient frequencies Message-ID: <20210906081733.GA4151@e120877-lin.cambridge.arm.com> References: <1630405453-275784-1-git-send-email-vincent.donnefort@arm.com> <1630405453-275784-7-git-send-email-vincent.donnefort@arm.com> <20210902105037.GA136543@e120877-lin.cambridge.arm.com> <20210902134927.GA147718@e120877-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org [...] > > > > > > Moreover, if only efficient frequencies are to be used, RELATION_L > > > needs to return min(policy->max, the closest efficient frequency equal > > > to or above the target). > > > > You mean, never returning an inefficient frequency, unless there are no > > efficient ones in the range policy->min policy->max ? > > No, that's not what I mean. > > First note that the target here is clamped between the policy min and > max. Also bear in mind that each of them is a frequency from the > table, either efficient or inefficient. > > In the first step, search through the efficient frequencies only. > That will return you something at or above the target. If it is at > the target, you're done. If it is above the target, it may be either > within or above the policy max. If it is within the policy max, > you're done. If it is above the policy max, you need to search > through the inefficient frequencies between the target and the policy > max (and you know that there is at least one - the policy max itself). > > So what I said previously wasn't particularly precise, sorry about that. I might have missed something but it seems equivalent to what's currently done: Find the appropriate frequency, if inefficient go to the efficient one, if above policy->max return the original inefficient frequency.