Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2974290rdh; Wed, 27 Sep 2023 20:52:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5zDaTSC0ylbgGKgJkSv0JHdYRHQHFxtXX8da78rG6OwkttxlzVTZEOwcu4LQgnncyHa7A X-Received: by 2002:a17:902:b7c4:b0:1c5:cbfb:c166 with SMTP id v4-20020a170902b7c400b001c5cbfbc166mr136plz.37.1695873128295; Wed, 27 Sep 2023 20:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695873128; cv=none; d=google.com; s=arc-20160816; b=tzioxpB0lHi0VYH928Xb47O9i9l8nVrlxRrwoPkDYhYmilCb9dNyWONTeuCloUltAg oO83YR5X+A3Ty6+x89kRSi2rBsWGn8KsV7Pgw+Qv2nWhiYdC4UigqngMLM1FPZG9TOD9 DasWr8s5etpFTm5shUCKNkyC0HGenJf/0TwDyAjgizD9bMC9/50Sl5pg8o+HxAneTTR2 DhHvq9C17v5pYmORUO74jn5ZkI1VtWmslBHgwJRiwdsCEX0Zd01bq+c/Ki0pkemtMDa2 CC5iqBJHqv3dNA9fOs9wh5uSLy/cxB7p+833RXTAIflHpbW2WH/uKTKAnKkrgYm8H+qp vnGA== 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=cZzt5XBuyL7sQG3cvWFg8cgyTXnGH+fRJeVaRnN9Qf4=; fh=k7xEkiTGhFla/PTKqpjMmrtBn2WEwlyJ654UsIBVaYo=; b=lHy2B916p4xiOwW9neE9atOCcHg6c7CTCQiFtrlGzewea/DK7qeSjNjxUk33K/oJib 3h+XMI2jGMWOxhD3A1MZ8Zf6yNVmxqtWeukTAo+0vuwiC447EkgiEvaD1YpFb472ieC3 29sXt7aqpw0sRcL5uqv/Q1IR0mym/y6rVY5HfGfoJPRR/twBkI/nbMP87ZV/StXZ1D8v zyYg7EDuuDp72xRJMlB1kQFTDkgJ7MD2oQnCLPmp0jc8BU+bapNfVYnWL7ZQm5cbf1rP N1SMDlD+ESvlG4yNXPkpAnDWXBkkk1AdUYnt6oaflnSJqqLmCN88C+37kqzG0bU0xaM4 jM0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I8qoBeGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id l12-20020a170903120c00b001c20db25104si18820059plh.117.2023.09.27.20.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 20:52:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I8qoBeGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id BA9F7805A792; Wed, 27 Sep 2023 08:47:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232650AbjI0PrJ (ORCPT + 99 others); Wed, 27 Sep 2023 11:47:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbjI0Pq1 (ORCPT ); Wed, 27 Sep 2023 11:46:27 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7E1E272B8 for ; Wed, 27 Sep 2023 08:46:22 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3214cdb4b27so10622221f8f.1 for ; Wed, 27 Sep 2023 08:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695829581; x=1696434381; 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=cZzt5XBuyL7sQG3cvWFg8cgyTXnGH+fRJeVaRnN9Qf4=; b=I8qoBeGoQCFR4356SJJmVTiXDRQO2Ib/LlfXEC14r/K+CLLEcbg4IHiwu9T7q6ZKBU g2GOHjK8ES38mmN53GRHZbLl/v2Hb3MfZiO19qIoj4u9zUhfR4JHKA3f8G6eVERBqyeS I2dUVRwgjXOToApRcMIjFrfMKf3tjIU88x20dlR5BnmULiEMLE4VULE8vpLW1oZRjEn0 9AdWH8UV8g/VcuL7OkKuueA9tNSPmx/Nd5VPTvrou1BPkAW0Cq9Gc9LEhYbzUqpqAEju 3FDMXQCDkmR3rTRbE9qg/wV3JXj68cKPdaRXfyN0MaieLJ1Jju/fPHMdeHQ/h/ceRqEd MtYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695829581; x=1696434381; 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=cZzt5XBuyL7sQG3cvWFg8cgyTXnGH+fRJeVaRnN9Qf4=; b=SkcMsZMKkizLrbGlLgg+ym+6gIgqf8OVCYMzaqJONhAzs19/cb5Zl6GTRvVlZlbM8W fLF33cczkJFs4gv3rynO89BnCNL0pU0btQGWRHTU2TQGz0I/eBGPMwy9Zz4TMuggel7p kNDHXnPyHffmgQiWgV7otmUs3O7PrZtqtCfjJyaup25b0K/YIyh6zXraZ14ULm0GVIkY PWWZlvUIUe9wI5kG7nLXcPe0doRMZOc61aAxOYQ3CKKPtlrsnL3zXkkSiLjeL4p/fNVL WNE2431AKcceEo2RdOXT2xsGI0q6SA18xwyx0oSln4bFil9s9rCPze8Hn9rAAVR2p6B6 C01Q== X-Gm-Message-State: AOJu0Yz1HIRZxOP0uxPJf+fVHk/bqu+8GP8iWasco6JwxaFa3GOsooQ2 vhiePG3zPywSs46IjHg4zfSvnA== X-Received: by 2002:adf:f707:0:b0:31f:d8b3:e9f5 with SMTP id r7-20020adff707000000b0031fd8b3e9f5mr1972549wrp.34.1695829580788; Wed, 27 Sep 2023 08:46:20 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:c49e:e1a5:3210:b8c0? ([2a05:6e02:1041:c10:c49e:e1a5:3210:b8c0]) by smtp.googlemail.com with ESMTPSA id c9-20020a05600c0ac900b0040646cf9fa7sm1394994wmr.42.2023.09.27.08.46.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Sep 2023 08:46:20 -0700 (PDT) Message-ID: Date: Wed, 27 Sep 2023 17:46:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v1 07/13] thermal: gov_power_allocator: Use trip pointers instead of trip indices Content-Language: en-US To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Linux PM , LKML , Linux ACPI , Srinivas Pandruvada , Zhang Rui , Lukasz Luba References: <1957441.PYKUYFuaPT@kreacher> <2590280.Lt9SDvczpP@kreacher> <9f1374db-f866-ff52-e86c-99fecee24d1b@linaro.org> From: Daniel Lezcano In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 27 Sep 2023 08:48:00 -0700 (PDT) On 27/09/2023 17:27, Rafael J. Wysocki wrote: > On Wed, Sep 27, 2023 at 5:10 PM Daniel Lezcano > wrote: >> >> On 21/09/2023 19:55, Rafael J. Wysocki wrote: >>> From: Rafael J. Wysocki >>> >>> Eliminate the __thermal_zone_get_trip() usage that adds unnecessary >>> overhead (due to pointless bounds checking and copying of trip point >>> data) from the power allocator thermal governor and generally make it >>> use trip pointers instead of trip indices where applicable. >> >> Actually the __thermal_zone_get_trip() change was done on purpose to >> replace the 'throttle' callback index parameter by the trip pointer and >> removing those call to __thermal_zone_get_trip() while the code was >> using the trip pointer. >> >> IMO, the changes should focus on changing the trip_index parameter by >> the trip pointer directly in the throttle ops. > > So you would like .throttle() to take a trip pointer argument instead > of an index? > > The difficulty here is that the user space governor needs to expose > the index to user space anyway, so it would need to find it if it gets > a trip pointer instead. > > Not a big deal I suppose, but a bit of extra overhead. > > Also it is easier to switch the governors over to using trip pointers > internally and then change the .throttle() argument on top of that. > >> The pointer can be >> retrieved in the handle_thermal_trip() function and passed around for >> the rest of the actions on this trip point > > Right, except for the user space governor which needs a trip index. > And the indices are used for tracing too. Given the userspace governor is going obsolete and the notifications are for the userspace, which is slow, we can retrieve the index from the throttling ops -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog