Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp802880rdg; Fri, 13 Oct 2023 01:12:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7g0r9oyKKwJi/m7pqWBsbPZaLnIJc7ACwGMdB+kksRdY2RM6QcL8KQiB4jkZVkh1UZIRB X-Received: by 2002:a17:903:11c7:b0:1c7:6fd8:442d with SMTP id q7-20020a17090311c700b001c76fd8442dmr25752106plh.67.1697184759408; Fri, 13 Oct 2023 01:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697184759; cv=none; d=google.com; s=arc-20160816; b=oyyJ9Kk+4n9Bhu2sKMCwYCXwjAF+oEwdBQD13sVuOIhCuNAc5tX/oPSkUdwEYN8bRb ccxlhggRM5piKaRUY1nSOap+V/olLSmYb8+2ffcYpqgnUDR1rH0y/azvqB1rYQa9ZXqJ u/Vw3/ic3yR3D4e/FjhY8jeptGJDPijSJpwb+jRaW9TTAlxoh/w7n5qoZpl5ifmcyKhx rvA+hlSSg+4oGOtE5QJyy6PYaQFoFWCHg545AE0iDFrCJxGWHqyea5MS4a8TaCJeU126 m/9z5fWB4JhIIVppHVXhzxBiS6uIdPgNLaN0LtSImUHAnZPWHfdVwkPYSBBtnit1iVKQ uAjw== 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=xzA53aRHqwecA/cL4i86evIoutzS7wgY6Wf1N9ugYl0=; fh=Jhb7rxZsQO0DdPOhq7EvFSKoHEjO13TbzKhGE3E43sU=; b=d3xgUzzKqoAeGcP8eE2xuI6QpGr0bhEXzCO5X7pLoq28PkFtV9UG67QCfo03zqKRMI G15PYxYqtze5rUb2TiuFQajL2mspsqcp8gY656eFXdD94Ih54cfaz3ar41oMENyuuJMi uES97Zp2xU+6wfZ56K3W8W1qz8Dq1PvOqL8zF4J/qcUAx9/QG+3g65gVt4KFsYX4gqAA 29kPAXCx5ReP6MG9VozAgJH6HdKXlRICJMY0ZFLyC1mtkXtJXvFo8orpUu8U22Bok6Qp C4gZX9pW5wf+x63izbioI8/AGp0uxJF+7ScS15As2u6wsqewuWIO61eCqe6H/LeokccF uHvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id n17-20020a170903111100b001c32d285db8si3641550plh.308.2023.10.13.01.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 01:12:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 358F3808FA4F; Fri, 13 Oct 2023 01:12:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230073AbjJMIMG (ORCPT + 99 others); Fri, 13 Oct 2023 04:12:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbjJMIME (ORCPT ); Fri, 13 Oct 2023 04:12:04 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 10038B8; Fri, 13 Oct 2023 01:12:03 -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 423D411FB; Fri, 13 Oct 2023 01:12:43 -0700 (PDT) Received: from [10.57.80.116] (unknown [10.57.80.116]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BF9193F7A6; Fri, 13 Oct 2023 01:12:01 -0700 (PDT) Message-ID: <0f6d3d0a-3685-4a0c-b922-b5aa72f20b19@arm.com> Date: Fri, 13 Oct 2023 09:12:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 0/6] thermal: core: Pass trip pointers to governor .throttle() callbacks Content-Language: en-US To: "Rafael J. Wysocki" Cc: LKML , Linux PM , Daniel Lezcano , Srinivas Pandruvada , Zhang Rui References: <13365827.uLZWGnKmhe@kreacher> From: Lukasz Luba In-Reply-To: <13365827.uLZWGnKmhe@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 13 Oct 2023 01:12:36 -0700 (PDT) Hi Rafael, On 10/6/23 18:38, Rafael J. Wysocki wrote: > Hi All, > > While working on https://lore.kernel.org/linux-pm/4846448.GXAFRqVoOG@kreacher/ > I started to change thermal governors so as to reduce the usage of trip > indices in them. At that time, I was concerned that they could not be > replaced with trip pointers overall, because they were needed in certain > situations (tracing, debug messages, userspace governor) and computing them > whenever they were needed would be extra overhead with relatively weak > justification. In the meantime, however, I realized that for a given trip > pointer, it is actually trivial to compute the corresponding index: it is > sufficient to subtract the start of the trips[] table in the thermal zone > containing the trip from that trip pointer for this purpose. Patch [1/6] > modifies thermal_zone_trip_id() in accordance with this observation. > > Now that the cost of computing a trip index for a given trip pointer and > thermal zone is not a concern any more, the governors can be generally > switched over to using trip pointers for representing trips. One of the > things they need to do sometimes, though, is to iterate over trips in a > given thermal zone (the core needs to do that too, of course) and > for_each_thermal_trip() is somewhat inconvenient for this purpose, because > it requires callback functions to be defined and in some cases new data > types need to be introduced just in order to use it. For this reason, > patch [2/6] adds a macro for iterating over trip points in a given thermal > zone with the help of a trip pointer and changes for_each_thermal_trip() to > use that macro internally. > > Patches [3-5/6] change individual governors to prepare them for using trip > pointers everywhere for representing trips, except for the trip argument of > the .throttle() callback and patch [6/6] finally changes the .throttle() > callback definition so that it takes a trip pointer as the argument > representing the trip. > > Please refer to the individual patch changelogs for details. > > Thanks! > > > I have issues to apply this series, could you tell me the best base branch from your tree? I will give it a try on my boards and review. Thanks, Lukasz