Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1379137rda; Mon, 23 Oct 2023 10:40:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVr/SCCZzUdi+OTzMXtgS78X8zArRBov9ktPldvW39PLaUejdvN+8ANOa5DagK9hYAJ6RD X-Received: by 2002:a17:903:2286:b0:1bd:da96:dc70 with SMTP id b6-20020a170903228600b001bdda96dc70mr10550986plh.49.1698082840245; Mon, 23 Oct 2023 10:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698082840; cv=none; d=google.com; s=arc-20160816; b=VDDg2kgkt7EiYwB7OWwiwRsFLICNWi8sApqgwDJjitU3SJ6ZdmNIl1H855I+I/1Mea zlYeGDK6gJjUdkqXs6kep0pMYv25jO4qsYxSLNVAX9lWxHlLiZB81eYHNnIggV4+yRtH nBrY6dQnar8vSWUHHHu9DsebUh2dY8Fc1sxJkWk9WBdTWKmYMwpcXg3BcZGdfuga8PyK /eA3qc7/FuPpVW6cbtHRTfpCvPFix3vwubMsa79nY2hcy6/PHSaek/evKvr+i23PX5VM ANZDs+n+AbjKqHy3o28Cq+0BsgVhK09OvkQkDLf+F2khY0HxDV++rw+aRFCPriStphXE 2wag== 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:dkim-signature; bh=kNQwyaGuIu7F+p1B5DfVkuQ0+sVIXi1xDTFxBww6HMA=; fh=QJuY8+zxrkMd3cgKvCdr6Bf20f7nJzeDcOkNXeH+l1I=; b=rzU2Uvg44nOq1Gq3gR2+OQiITzjz0/6Fmb+dYwqvKFQqg6jmAdJo2lF4qSJPxVNyom 7NZvJ+aCgAWMB2I5LTslDOFC1fhfGfD/9JCY664t7vg2DhwGt293ZpLixFBTTu9kuXSb q5reVlLhm+sS4ZIwhPQMOm6J1mfuZEVrUL7txUIO0/cPIGXOQ3AsTqbGYMpqAobTqXvV tDs6GoYamLdltHIYMLSMnnKMpwGcRUpNADNFMvs3uBUhs6bKC6qXcAIoAOsFkzRWfNQX x1ywIX6050BOoW/zDv4XOAfDmC5fAna9C0W51+2yvhEa9VO2eJGVGlMzath0alpxrlVK d5Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xtjytsbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id 19-20020a170902c15300b001c9c599f77bsi6377444plj.312.2023.10.23.10.40.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 10:40:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xtjytsbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E90068035117; Mon, 23 Oct 2023 10:40:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231887AbjJWRj4 (ORCPT + 99 others); Mon, 23 Oct 2023 13:39:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbjJWRjz (ORCPT ); Mon, 23 Oct 2023 13:39:55 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 631ED83 for ; Mon, 23 Oct 2023 10:39:53 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2c50305c5c4so54524421fa.1 for ; Mon, 23 Oct 2023 10:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698082791; x=1698687591; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=kNQwyaGuIu7F+p1B5DfVkuQ0+sVIXi1xDTFxBww6HMA=; b=xtjytsbA95msPyo7nVmtcboi3OOTLSfzrYxFRMTxtVpcEL0GBIw9mX4CfxOpuGTRbW Jsn3+jBGAt4NYgMezVRzt2O7N+PuwfgdqKqe/GQkIc7DV+Or24kl08aO3OEYJmAMW16/ ITDI/WrA1hc3cCbuH4doBxDj5ID8NcHQZvcJcUmXaRHMx0JsDf43PtJ+VOIaMW5ovZFP H2G/hFAhgxzlc6kMWOzY90OSQNxflXGvkm+ycUV8MJVCTc7jIG2lHGG4BIq50u2h7mHG T0ENJRHq3mQymexePM34nrbXaxaWn6OgWmIml/edi1lYD67etNMxT/CfFm5TH8Mas8eX 3U+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698082791; x=1698687591; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kNQwyaGuIu7F+p1B5DfVkuQ0+sVIXi1xDTFxBww6HMA=; b=Cl83XEtjCeJN8sYEAx19GxKwxnKy/C1+GmRKwuQ0FjG0nFT1a8odX51GrMvnGZX8uf mJEaT1zr9rJf9IDaojcuQ//oSk0D3iktsH/szroXTD1Z+B/5zjTBiQ8/glKLhfEE9auV XJ/gxZhTFp/8aqakDNtDrIMpTlkP/ZkxsBdwZwyirUj8FA2fSGJ5O1ZjvWyTg338+CIz JE66YrIwxC6brT+SjbJNiX5Mkl+MnIvwXj93qSeb0T99nVpz0uIScjtsPEqguMQJ4kAg tp14zN8dwEB9ZtSAArfNUGjyKinpwy/7usZl4vBuM/A/kvET/o35Sf38WoxOqi6xJ8Qt IvDA== X-Gm-Message-State: AOJu0YzPXMvrjBbRYge4XIJUUTbzN84dnyn9OAq8I/pGAKDEZ7+mOv1Q Oi/spFanETgFACqJoKNTmhpXoJ0kqW1BMl6A9waEJQ== X-Received: by 2002:a2e:7a0d:0:b0:2c5:40a:5d92 with SMTP id v13-20020a2e7a0d000000b002c5040a5d92mr6557526ljc.28.1698082791553; Mon, 23 Oct 2023 10:39:51 -0700 (PDT) Received: from [192.168.198.23] ([37.166.25.68]) by smtp.googlemail.com with ESMTPSA id n35-20020a05600c3ba300b003fef5e76f2csm4485092wms.0.2023.10.23.10.39.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Oct 2023 10:39:51 -0700 (PDT) Message-ID: <6786c91e-12ce-a9dd-12fe-bc02c6d782b8@linaro.org> Date: Mon, 23 Oct 2023 19:39:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v4 04/18] PM: EM: Refactor em_pd_get_efficient_state() to be more flexible Content-Language: en-US To: Lukasz Luba , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rafael@kernel.org Cc: dietmar.eggemann@arm.com, rui.zhang@intel.com, amit.kucheria@verdurent.com, amit.kachhap@gmail.com, viresh.kumar@linaro.org, len.brown@intel.com, pavel@ucw.cz, mhiramat@kernel.org, qyousef@layalina.io, wvw@google.com References: <20230925081139.1305766-1-lukasz.luba@arm.com> <20230925081139.1305766-5-lukasz.luba@arm.com> From: Daniel Lezcano In-Reply-To: <20230925081139.1305766-5-lukasz.luba@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 10:40:04 -0700 (PDT) On 25/09/2023 10:11, Lukasz Luba wrote: > The Energy Model (EM) is going to support runtime modification. There > are going to be 2 EM tables which store information. This patch aims > to prepare the code to be generic and use one of the tables. The function > will no longer get a pointer to 'struct em_perf_domain' (the EM) but > instead a pointer to 'struct em_perf_state' (which is one of the EM's > tables). > > Prepare em_pd_get_efficient_state() for the upcoming changes and > make it possible to re-use. Return an index for the best performance > state for a given EM table. 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. > > Signed-off-by: Lukasz Luba > --- [ ... ] > @@ -251,7 +253,9 @@ static inline unsigned long em_cpu_energy(struct em_perf_domain *pd, > * Find the lowest performance state of the Energy Model above the > * requested frequency. > */ > - ps = em_pd_get_efficient_state(pd, freq); > + i = em_pd_get_efficient_state(pd->table, pd->nr_perf_states, freq, > + pd->flags); nitpicking but s/i/state/ Other than that: Reviewed-by: Daniel Lezcano > + ps = &pd->table[i]; > > /* > * The capacity of a CPU in the domain at the performance state (ps) -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog