Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4207714pxj; Tue, 25 May 2021 02:48:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxT8Naob7q/XN7RYmOArDODI6t7GVA24xl3enw62WoaqmZoFqPTufj/x/Ls0LJ615vJ9xio X-Received: by 2002:a92:d18a:: with SMTP id z10mr20402376ilz.70.1621936108425; Tue, 25 May 2021 02:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621936108; cv=none; d=google.com; s=arc-20160816; b=EA/lbNQbBj8DqYMjxFwZtHL8FcqGRyxGodQNVnzRG8bTqsloAyJ36AEOzRDnxLWJmI Oou20STtnnhEeUxCAefNV0I+YxcUOCvn06YjfPqKqtLME9L0foL2pYqqF8z6rIjEA0vl fUolflQ3AXur6uOO4qxcwXCfc9rlNcv6lriUbAZYXylXWgJhsew2MO6yku4fZjuaymLT 8nwto6FlHTQcALjcevpQFB7oh88v7p5cXzTOSD24pVLpoeHdQFPEqwX/gbvhLdFrq5D2 OcmekaZU8ENSVkTZUmctOpXRFGrYGZkKUuF2mFXVlxzk0JCe2CaXnUoeFZRDMctBdzoc 5akw== 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=vijqJpTARjNFUcJu93kCkfBabOy4b8Drxh5O13x6Enw=; b=EPAGhjfgH93/duvpPEUgtONFifnKX+slxXd9/pT6YCsT9eDZ+wXiQjmOWdxc7ZzRql mpA9ySu9EHeeIuhTmjzIi8NamARk7WJnhjDA86ezLtXaudK8WDIYK39ZaWPcnkngPb8L sCt+UMgBM1RiejM2gFWrHswSHw+/QhqHgL0qcjmzN6Ri/qKDvh8jfK7u+eOUkcXBtIeA Nc5nZNkyH4z0MFGDxYiAAKhklolwQOOwnmyXudsm0vSmINO8V4L4sKZB5LklLU9OE01P 4NSFwwt0iPu8/D8pm3PzRlsk21dJQPnBF9qIgGCgW1kpVestLXzaO7zosz0QEaW0cHkh SYNQ== 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 b10si8728085ioj.35.2021.05.25.02.48.14; Tue, 25 May 2021 02:48:28 -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 S232698AbhEYJsd (ORCPT + 99 others); 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 {