Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26462924rwd; Mon, 3 Jul 2023 10:01:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ49PSifPHIHv+4IYGUWaZsZLxos8ndcRuTddnYPjjXscDTXw4zzwS5mGwhxu88Uzm2RNxch X-Received: by 2002:a05:6808:1525:b0:3a3:5e2a:cd9a with SMTP id u37-20020a056808152500b003a35e2acd9amr8923850oiw.48.1688403667947; Mon, 03 Jul 2023 10:01:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688403667; cv=none; d=google.com; s=arc-20160816; b=y2yF+1W4yYeeEc9/fSWqgyN3ZeW0w2bIedBAbf/K80snh6G6XD0V9z7JzbctAJStR1 xZ5ieU+//Fxs/M8cunctDM/2UNrShivVLJKnE5DvCRnhDna/BUSpZe0oBWS6gL2/2TZi rlt3dZhEhRU1C1/Tn5ElLQZJX2CWOytcBlhOukRIzmMclUkIhTFIeR/dE+CbCylViueA WRkaziLjqsyQYQE0XQvK46ou0wiq7VfjX/7qDG5eLhoEahVUKuf31Rsw24LxfGgi6lMd 3e4Yfo0vRsuarHnyoCU+jK9XZbjRbHYU5MUqoOz7LfckYm4h4mbyHuyRqdT3rRhJwIf6 gVdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=HOIQUpoL3DkkUi8LqgqPmwqIuDV1ljcxTk1ZscdvuNM=; fh=Wo22gSJCRwTLyDzb41myy9Bl+2SFoGi1RZ4iP0fKd98=; b=zMScKnumcsbA3Dc9EUJLY1oBbUwItNRCwZ6Pq/35QEK5YNrQXH+iwZZi9W2SAix5Ua oyevKMFRxFiV88FAXo8oMNpr/qfvoAaiqGCoyUereuHl8F+JWG1BF/4mXiHcHGQ17He9 JqcOiV+B8MruOV33gKGmDeFv8a6nhiKdOC/8rFbFQgUGnko3tULVfSYaooYp2S1PbufV 2Smb/X6KQfwoVfri5zbdMOW2gk8HFsYj5xID3tvu6bL9oPQeY5xTacrQ5Rk3DSRQqQ8P jky5Zvt8w6d1RkJd6hKoMVPWVTZOWUUMBgXsi0//02s65e/r/xTMaAeepIy8MKpq9g1J wgHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w184-20020a6382c1000000b0054ff67daa8csi18462272pgd.751.2023.07.03.10.00.38; Mon, 03 Jul 2023 10:01:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230493AbjGCQWg (ORCPT + 99 others); Mon, 3 Jul 2023 12:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjGCQWe (ORCPT ); Mon, 3 Jul 2023 12:22:34 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A1D25E42; Mon, 3 Jul 2023 09:22:33 -0700 (PDT) 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 2F10A2F4; Mon, 3 Jul 2023 09:23:16 -0700 (PDT) Received: from [10.57.27.93] (unknown [10.57.27.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E29FE3F663; Mon, 3 Jul 2023 09:22:30 -0700 (PDT) Message-ID: <4e16fb56-7628-8b2f-182b-170a85168cb8@arm.com> Date: Mon, 3 Jul 2023 17:22:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2 03/17] PM: EM: Refactor em_pd_get_efficient_state() to be more flexible Content-Language: en-US To: Dietmar Eggemann Cc: rui.zhang@intel.com, amit.kucheria@verdurent.com, amit.kachhap@gmail.com, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, len.brown@intel.com, pavel@ucw.cz, Pierre.Gondois@arm.com, ionela.voinescu@arm.com, rostedt@goodmis.org, mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rafael@kernel.org References: <20230512095743.3393563-1-lukasz.luba@arm.com> <20230512095743.3393563-4-lukasz.luba@arm.com> <418bef75-883c-2442-3376-03fd7537c734@arm.com> From: Lukasz Luba In-Reply-To: <418bef75-883c-2442-3376-03fd7537c734@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/30/23 12:06, Dietmar Eggemann wrote: > On 12/05/2023 11:57, Lukasz Luba wrote: >> Prepare em_pd_get_efficient_state() for the upcoming changes and >> make it possible to re-use. Return an index for the best performance > > Don't get the `possible to re-use`? Did you mean `possible to be > re-used`? But then `re-used` for what? The function will no longer get a pointer to 'struct em_perf_domain' but instead to 'struct em_perf_state'. It would also require to get the number of states from 'pd->nr_perf_states'. This is preparation for handling 2 tables: modifiable (a) and default (b). Then it also returns and ID not the pointer to state. It all makes it more generic and ready for those 2 tables. > >> state. The function arguments that are introduced should allow to >> work on different performance state arrays. The caller of >> em_pd_get_efficient_state() should be able to use the index either >> on the default or the modifiable EM table. > > This describes the WHAT but not the WHY. I will add that description as 'why' in the header. I wanted to avoid mentioning in the patch description something which is coming in the next patch.