Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3786510rdh; Fri, 29 Sep 2023 02:10:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjC6t8I/IsZmpQaR0z2AIJe2eH7a3/5u/iPkbENXwFJlTaYNW4DquC1JIX/4BhjlJLyZZK X-Received: by 2002:a17:902:d4d0:b0:1c0:bcbc:d67 with SMTP id o16-20020a170902d4d000b001c0bcbc0d67mr7118082plg.22.1695978656026; Fri, 29 Sep 2023 02:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695978656; cv=none; d=google.com; s=arc-20160816; b=QKyM7RozwoeltNTVQfa3QHnh7GfvpPr19ICFHG9GAE/C8L5rqJuilrCkh2bkMEH7Yh pEsSRINH1GW2owamrvVh1OmYX6l2iY+2Dvjm0OOBitwtOYPe5jW5QyX6PjV3OpRPehlB 1wdK8iYCZDwOTNWE0xB8lesNocyVx5rIUX6DIvFcDHzmUy2rpUWq8oq4akY6i3/NlxiX z6XtoEGPNVuZiVVblXmTe8NRPB7QndIvped+QRJ73ijUZPhRFWMCFnkN1rdqhYA2d4b7 GiaGKhG6N5/SvW+dM/li9X52Xf7nEIDLzAQ8QYQ465uq+m3nu+8ZXmMWtBOPOFhsE9Tr kOiQ== 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=RyuSQcy7a6BZNUfQIJX9FVqRUmtk/3aqy+DHV8vASr8=; fh=Sntd+G0CthFoKfHeh5KAtcEJMuc35jsG6LFomUCRudQ=; b=FEfORsZC6rLoPNOGOtybaqPEEVCLuZ6z6CLvcv80LArhLil5F2VXGYbgpiQcP5S3YJ +Il2kFjHazMw6g+Z0kvN8Gu9Nqr46YEDeUhaoh2WaMYD2+rd10cLgaJNVCpuexc8TVpk EMfYXqYsyqOqMVQErDxEDZquYUJMOv95ZnpAj34KnnC9JebQcwta9fLnIPmOP6takgm6 jzH/FZ5tS2C/gQf9q6jHQcV1R8WHj9HrmWpEN6OeXmK7mHsJHEb8gCkYPfIPL25oLljF fhOkjTNzCBFSeLEbezhsdEvoT3LTBuDKhm+aPNSTOOvRQMDsTJRw5SUxnPluc4XJjoal k+/A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id a14-20020a170902ecce00b001b8ba81d04dsi16031506plh.395.2023.09.29.02.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 02:10:56 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id F1AF4807EB10; Fri, 29 Sep 2023 01:45:29 -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 S233020AbjI2IpL (ORCPT + 99 others); Fri, 29 Sep 2023 04:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232993AbjI2Ion (ORCPT ); Fri, 29 Sep 2023 04:44:43 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DB83510DE; Fri, 29 Sep 2023 01:44:25 -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 02282DA7; Fri, 29 Sep 2023 01:45:04 -0700 (PDT) Received: from [10.57.93.169] (unknown [10.57.93.169]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5FD9F3F5A1; Fri, 29 Sep 2023 01:44:23 -0700 (PDT) Message-ID: <7e2e64d7-4b10-8d58-03c9-e5a5129f864e@arm.com> Date: Fri, 29 Sep 2023 09:45:03 +0100 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 07/18] PM: EM: Refactor struct em_perf_domain and add default_table Content-Language: en-US To: "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dietmar.eggemann@arm.com, 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, mhiramat@kernel.org, qyousef@layalina.io, wvw@google.com References: <20230925081139.1305766-1-lukasz.luba@arm.com> <20230925081139.1305766-8-lukasz.luba@arm.com> From: Lukasz Luba In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.0 required=5.0 tests=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]); Fri, 29 Sep 2023 01:45:30 -0700 (PDT) On 9/26/23 19:52, Rafael J. Wysocki wrote: > On Mon, Sep 25, 2023 at 10:11 AM Lukasz Luba wrote: >> >> The Energy Model is going to support runtime modifications. Refactor old >> implementation which accessed struct em_perf_state and introduce >> em_perf_domain::default_table to clean up the design. This new field >> will help to better distinguish 2 performance state tables. >> >> Update all drivers or frameworks which used the old field: >> em_perf_domain::table and now should use em_perf_domain::default_table. >> >> Signed-off-by: Lukasz Luba [snip] >> diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h >> index 8069f526c9d8..d236e08e80dc 100644 >> --- a/include/linux/energy_model.h >> +++ b/include/linux/energy_model.h >> @@ -36,9 +36,19 @@ struct em_perf_state { >> */ >> #define EM_PERF_STATE_INEFFICIENT BIT(0) >> >> +/** >> + * struct em_perf_table - Performance states table >> + * @state: List of performance states, in ascending order >> + * @rcu: RCU used for safe access and destruction >> + */ >> +struct em_perf_table { >> + struct em_perf_state *state; >> + struct rcu_head rcu; > > There is no explanation of the role of this rcu_head in the changelog > or anywhere in this patch. > > It is also not used as of this patch AFAICS. > > It would be better to add it when it actually gets used IMV. That's a good point. I will introduce this 'rcu' field later.