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=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 69BBAC433FE for ; Mon, 6 Sep 2021 12:08:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DF3660C3E for ; Mon, 6 Sep 2021 12:08:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241947AbhIFMJ5 (ORCPT ); Mon, 6 Sep 2021 08:09:57 -0400 Received: from mail-ot1-f53.google.com ([209.85.210.53]:43898 "EHLO mail-ot1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241957AbhIFMJ5 (ORCPT ); Mon, 6 Sep 2021 08:09:57 -0400 Received: by mail-ot1-f53.google.com with SMTP id x10-20020a056830408a00b004f26cead745so8513102ott.10 for ; Mon, 06 Sep 2021 05:08:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y5pk5y6gKDVMJwSGFI3AllVU0ilmGCKw8WHHRV/7IxM=; b=qK2UcK9jOydAWP/HpOChaOLWaDKcstjN4EkLUngljFeoHEFOQrzj1o5iNA0tnLqhe2 ZX0r5ZQhkkjktHpbJVLixV96euK74H97J7Fm/ws4YFydrwTtth4LTxT4d926qrFU3cz0 NKr+xFlAChE5cmCorh7xyZi02Yc7om2vmgydH8F7wfF0c0MxmdNrRShRs73A7LikpobH yIwTFGGkam5TtW7SRdNNPaA+Nz6M1+lkM7S2gkQyeFuSGt6WHQapkFIw5IEKy/ym2BS0 auO3+Dq4SCNc4uJlil1bjF5qYV6B5Z8NgFAU0jDNLbi+EDEt/gIsgTZnXUNLJIMIxDlP uacw== X-Gm-Message-State: AOAM530vtzKlabjaTMIIShgBCoswD8SP5btWVCmCLe1P49y4iofILqFN gWMLGQXuR3fpYZtxH9db+Hh/paRZLOgUEMOKCKo= X-Google-Smtp-Source: ABdhPJzCzfjQZk6dDtswTk2v4e+bEykPiZwx/dbKlbCKaARAHd5FOC7m6IEAK1i2cY13agPmsWZPgDMmmiwV7LDib8c= X-Received: by 2002:a05:6830:34b:: with SMTP id h11mr10726670ote.319.1630930132204; Mon, 06 Sep 2021 05:08:52 -0700 (PDT) MIME-Version: 1.0 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> <20210906081733.GA4151@e120877-lin.cambridge.arm.com> In-Reply-To: <20210906081733.GA4151@e120877-lin.cambridge.arm.com> From: "Rafael J. Wysocki" Date: Mon, 6 Sep 2021 14:08:36 +0200 Message-ID: Subject: Re: [PATCH v6 6/7] cpufreq: Skip inefficient frequencies To: Vincent Donnefort Cc: "Rafael J. Wysocki" , Peter Zijlstra , "Rafael J. Wysocki" , Viresh Kumar , Vincent Guittot , Quentin Perret , Linux PM , Ionela Voinescu , Lukasz Luba , Dietmar Eggemann , Matthias Kaehlcke Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Mon, Sep 6, 2021 at 10:17 AM Vincent Donnefort wrote: > > [...] > > > > > > > > > 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. It may or may not be equivalent depending on what the efficient one is. And what is there now doesn't work for RELATION_H if I'm not mistaken.