Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4263046pxj; Tue, 25 May 2021 04:09:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw3mcBq0WWgYNmx43P6lnYq3Du4v5clIhxtRu8XAg8bYFLNaJbmysoa0FE5MTOuskglt7n X-Received: by 2002:a02:aa97:: with SMTP id u23mr29508013jai.13.1621940999185; Tue, 25 May 2021 04:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621940999; cv=none; d=google.com; s=arc-20160816; b=u+4IecxaRVnEVh6hli2d8NMKxuNLn6Ga8C6NwJggRe2sooEmJ2edDDgs96MSZqlY7i qNQ/tOmh9RILTQsqew6DgyfK4sg81E6FgM5rIIVVxhBC0tNZuXLcuREG9ZRDn2tbmt22 3BQq96qHKnQErWH4zm9LHgPJ8hSiGHjLUiB8fsQblYliteU1gKUi3W2MNIh4bh3/X44b vOLzojiJ8lOrCEv0R67uM+5eHUZZurGAao3RYyqXnRvij36Wl5vq6k8YSNmJrpJE1PE3 Xk4YkvHK7jZfQ2+ZRfsPGf8feRN8hJCV4HA0zg20CO5UgqTiMkequgdqpDGfprpJh+m/ GwEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ePLFclkaRonrel2xBsuiQN2J+io51Sg0jAbpJLp8QCI=; b=xDjpLqRc5XQRR9Wy0FCUufjOw67eeEDGLbGE2gg7g1I7woOJSZ8GTOQwTQzcdesQ9i BTZEH2GEz+Gfg6luidnAFU0cIQ9wdOrCe+qxj79Yfp7tYq5hhO62z9yvAO0naqyyRXj3 C6+yEghikDDVe8evv9/Tt7xBeO2JEsWj2xQIhpL5X6yuo3xX7gdVogz6vHfC/h9OXftF 5c/c6giLh8lYxPF0NjYw5L3kqcN7Z1PmzZzVFp0SkpSYrTL7UbtqyLVoP8FZLK85GCy7 +1gBhBAdYB3KeEXlc7jIlkQzdXtYfuahfW4Z4bcbMOMYgfOofS4vEwXoWVQf6QHV3QNK 8+3w== 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 b1si17128644ioh.94.2021.05.25.04.09.29; Tue, 25 May 2021 04:09:59 -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 S230525AbhEYLGc (ORCPT + 99 others); Tue, 25 May 2021 07:06:32 -0400 Received: from foss.arm.com ([217.140.110.172]:54720 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230475AbhEYLGb (ORCPT ); Tue, 25 May 2021 07:06:31 -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 3FBF0D6E; Tue, 25 May 2021 04:05:00 -0700 (PDT) Received: from [10.57.0.41] (unknown [10.57.0.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EBF9D3F719; Tue, 25 May 2021 04:04:47 -0700 (PDT) Subject: Re: [PATCH v2 3/3] PM / EM: Skip inefficient OPPs To: Vincent Donnefort , 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, dietmar.eggemann@arm.com References: <1621616064-340235-1-git-send-email-vincent.donnefort@arm.com> <1621616064-340235-4-git-send-email-vincent.donnefort@arm.com> <20210525094601.GB369979@e124901.cambridge.arm.com> From: Lukasz Luba Message-ID: Date: Tue, 25 May 2021 12:03:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20210525094601.GB369979@e124901.cambridge.arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/25/21 10:46 AM, Vincent Donnefort wrote: > 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. > That's a few more instructions to parse the 'flags' filed. I'm not sure if that brings speed improvements vs. if we not parse and have bool filed with a simple looping. The out-of-order core might even suffer from this parsing and loop index manipulations...