Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp472240pxy; Wed, 28 Apr 2021 07:54:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUSpA3c+JvBbx3Cneo60dw/Y6IyW/8ENGW0pVgZE6g8C0F+hmXp1HMTkPvJ7z71DtHK603 X-Received: by 2002:aa7:c98b:: with SMTP id c11mr11910834edt.50.1619621678772; Wed, 28 Apr 2021 07:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619621678; cv=none; d=google.com; s=arc-20160816; b=TwbALRwpIF2+cM+6URCIWQBvE52wVPL+f/jOxVWLX/RisWIHv9P8xKA3D5kov7g59+ /yLMIgMr/RgoZRv1fgA9vQoo4ING9qTH4bChFwoqQefgmBPJQCtATcCKcKB4/4581TeZ 6PWgf5TOkQofFeNtAsa1UbuzIf/2qknET5ZKH4kdo4gj+jyeSqeMZ+I7JKiiaxQ/D2Vb EVdNH52ZePVRAwemiUhLFxNsv5xND3dS/akgMAjyozWxbk/O8w6d1R9Wm1te6SnsnO6o h9vsQeMpdLFUTCzGPvKyWe3ncnTcCJYbPuvqQjV4g3fjgg+7uLDA5UTt5NL8gL5Yg6jn XZUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=7Qwo/0CBmLPU6DMc15weqE0ZF/nIWDyCXqTx2rHL7pg=; b=e8+J3lMH+piQ666HR9cUKnj/uooR8gr9DtGlMCpQsMQzMHpuSCqqp6D8S/Mj9+UxHX 8OYSrOJo629lYQN4iH3DzXRV/GRaHQyausUHsbbK7QN/1vsDKz6ThVcZ+xUXm8rApRQd sqrk8lJ9QtOKagCNDR/pVoOmSTK46Tt7bLfOoG7M+0U3CWUqIYebtuNYy7oVF3tqns+c wsf1NsMjEWcWG/t1WGYcIt1UjdCZ1uJksfWMI3tieMq6JLFgWd9WYavz7osLJauVQ05A TXCsyXSvXEBLckQolz+OgYlCO+YRlorQtwO7b1MqtFgs4iKGIt4JkyaM/1MOkniIsKPq RYvw== 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 hp26si208831ejc.209.2021.04.28.07.54.09; Wed, 28 Apr 2021 07:54:38 -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 S231283AbhD1N32 (ORCPT + 99 others); Wed, 28 Apr 2021 09:29:28 -0400 Received: from foss.arm.com ([217.140.110.172]:42270 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230007AbhD1N31 (ORCPT ); Wed, 28 Apr 2021 09:29:27 -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 234971FB; Wed, 28 Apr 2021 06:28:42 -0700 (PDT) Received: from e120877-lin.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 DABB43F694; Wed, 28 Apr 2021 06:28:40 -0700 (PDT) Date: Wed, 28 Apr 2021 14:28:32 +0100 From: Vincent Donnefort To: Quentin Perret Cc: Lukasz Luba , 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 Subject: Re: [PATCH] PM / EM: Inefficient OPPs detection Message-ID: <20210428132812.GA71893@e120877-lin.cambridge.arm.com> References: <1617901829-381963-1-git-send-email-vincent.donnefort@arm.com> <1617901829-381963-2-git-send-email-vincent.donnefort@arm.com> <20210415143453.GB391924@e120877-lin.cambridge.arm.com> <20210415151446.GC391924@e120877-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 15, 2021 at 03:43:06PM +0000, Quentin Perret wrote: > On Thursday 15 Apr 2021 at 16:32:31 (+0100), Lukasz Luba wrote: > > Are you sure that the 'policy' can be accessed from compute_energy()? > > It can be from schedutil freq switch path, but I'm not use about our > > feec().. > > Right, I was just looking at cpufreq_cpu_get() and we'll have locking > issue in the wake-up path :/ So maybe making feec() aware of policy caps > is for later ... > > > For me this cpufreq_driver_resolve_freq sounds a bit out of this patch > > subject. > > Not sure I agree -- if we're going to index the EM table from schedutil > it should be integrated nicely if possible. > > Thanks I'm having a look at this topic right now and I don't think we can skip cpufreq_driver_resolve_freq() in the end, for two reasons: 1. It is possible to register OPPs (and by extension perf_states) for a frequency for which, the cpufreq table entry is marked with CPUFREQ_ENTRY_INVALID. It would probably be an issue that would have to be fixed in the driver, but it is currently allowed. 2. More importantly, while resolving the frequency, we also cache the index in cached_resolved_idx. Some drivers, such as qcom-cpufreq-hw rely on this value for their fastswitch support. -- Vincent