Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4239006pxj; Tue, 25 May 2021 03:33:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTg4kSQQu9wqmok7z+WLWWDRnHnl/JcoFyW0vEwkcp83RSjiAdUuhoV8A1wc+PxlOKJ+4U X-Received: by 2002:a50:bae6:: with SMTP id x93mr31045738ede.48.1621938815005; Tue, 25 May 2021 03:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621938814; cv=none; d=google.com; s=arc-20160816; b=k2WG6JoHY9Pg6VYrH/88/mJ/XoRbYtdwRe210zlV4vzoQl93ZqPOWtZKoUItxtQ67l HCCLv1ZVWVnZo8lcyqoXD+xLjA+fNOvRx377fGsm0eqik+qItqdfY0zqHxPsRPM1Hh3x Bov3QKftSKzn+IZuDYThVWLHH3sPZT9LeoBzOXEw4vj5QqC3LJPKMEFrXKLj9qgQGi4q 1gOlQqtNiVcmd2u8t3sSkRmekRpFlmQDmA4GtI3FuJTX9niYaBVVLc5bkLyjgiwutL+p 7ho4rNeT3IA4yIYINxbvpYxANo1TJbJsFQeQk6BwX/aV/WZpQ06P03rYCo6CxwQpZcM4 X5VA== 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; bh=Nbnx6PHis87JFQVrlMWfGLADUqsHc3gPG5hH3LOOVkA=; b=BMa9+zmlKaq3OXRsArhaaDB0MVhspvq+6LPvSEbvhACQKzmC9JdELHTvRvDxzorU/F BmTL3GWhcpmtMshmpWbL5465ygrSqtPtqCY29aXYnMpImCroRuBxko6VWXGYzsCwIDB1 h+YGEmtFNdIQIAj7/gK9sRAQMNWVFuqjlOC/1mFVu1jNsvPHJHfUcp3mQILUrLerIHRm cdXggjyVLtMVf7iYeUOTDkxPmy2pcOyxZ0auOGmnlvz7z1hw3gNuBDJgXMSxZ7K16Zao MIBBZyhrVU3GijHXocb0OyOEyUR6fFUX+QUkMy9G6NyiMF6+j8HFdAQ8T51P6233QLmq dEjw== 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 qk17si10834899ejb.430.2021.05.25.03.33.12; Tue, 25 May 2021 03:33:34 -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 S232684AbhEYJqf (ORCPT + 99 others); Tue, 25 May 2021 05:46:35 -0400 Received: from foss.arm.com ([217.140.110.172]:53938 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232618AbhEYJq3 (ORCPT ); Tue, 25 May 2021 05:46:29 -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 0F96C6D; Tue, 25 May 2021 02:45:00 -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 16C673F73D; Tue, 25 May 2021 02:44:57 -0700 (PDT) Date: Tue, 25 May 2021 10:46:01 +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: <20210525094601.GB369979@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 might be an interesting improvement. > > > dev_dbg(dev, "EM: OPP:%lu is inefficient\n", > > table[i].frequency); > > } else {