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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 9045FC2B9F8 for ; Tue, 25 May 2021 09:47:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7373961284 for ; Tue, 25 May 2021 09:47:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232689AbhEYJsd (ORCPT ); Tue, 25 May 2021 05:48:33 -0400 Received: from foss.arm.com ([217.140.110.172]:53956 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232682AbhEYJsc (ORCPT ); Tue, 25 May 2021 05:48:32 -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 6B9836D; Tue, 25 May 2021 02:46:23 -0700 (PDT) Received: from e124901.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 863F83F719; Tue, 25 May 2021 02:46:21 -0700 (PDT) Date: Tue, 25 May 2021 10:47:18 +0100 From: Vincent Donnefort To: Quentin Perret 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 v2 3/3] PM / EM: Skip inefficient OPPs Message-ID: <20210525094718.GA385567@e124901.cambridge.arm.com> References: <1621616064-340235-1-git-send-email-vincent.donnefort@arm.com> <1621616064-340235-4-git-send-email-vincent.donnefort@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 25, 2021 at 09:33:01AM +0000, Quentin Perret wrote: > On Friday 21 May 2021 at 17:54:24 (+0100), Vincent Donnefort wrote: > > @@ -161,6 +162,8 @@ static int em_create_perf_table(struct device *dev, struct em_perf_domain *pd, > > table[i].cost = div64_u64(fmax * table[i].power, > > table[i].frequency); > > if (table[i].cost >= prev_cost) { > > + table[i].flags = EM_PERF_STATE_INEFFICIENT; > > + pd->flags |= EM_PERF_DOMAIN_INEFFICIENCIES; > > If we're looking for micro-optimizations, then perhaps you could store > the index of the next efficient OPP (which would be 'i' if the current > OPP is already efficient), so you can jump to it directly when doing the > search. Wouldn't add any new field compared to this version so yeah it seems an interesting improvement I could add for a next version. > > > dev_dbg(dev, "EM: OPP:%lu is inefficient\n", > > table[i].frequency); > > } else {