Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2733286rdh; Wed, 27 Sep 2023 10:59:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmxdSAQjP6QsfeLy38wuXuNwiQfO9ctKLQv0kAT0YB1q0L99iusVlO5JnAY4Hxzypjejle X-Received: by 2002:a05:6a21:3295:b0:15a:2c0b:6c73 with SMTP id yt21-20020a056a21329500b0015a2c0b6c73mr3384089pzb.12.1695837564119; Wed, 27 Sep 2023 10:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695837564; cv=none; d=google.com; s=arc-20160816; b=nPm+NGUUCe8KQje/8+sxe7vOc1o2a5E4Vnr/0vWMT1/f/lUG1W8UUc5lFBJLHskgoC VeCEoGtqyxGjbUiY13BWgHxDtpBSXdtWgOVzXhD9SmZu0OG8JilTl7OZ2cvUv0jpbf+J PFVQGCuselV8Y/w+pRBHZwiJakhfPDXT5tO8bnZQmXYw86Cd0yfcnr19p/Q9QgP0t/9m H0kTw/0TC7kplzfWnJck1R4x1UgomR9Br9PVPKmtR0NwEfVphmeudPMqtBxUCxEcrMQr H2Rx3ks/BHyJUkp5cmuAy2NK+qmOTQDCfdsTOIptZlxaJPjC0pvhZYaz10Uu+Gh1yOuJ GvMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=e7B2obMVVHqeS42xVN5VSNqxxmF/IMR7/CoDD5DlWDk=; fh=3/NdhQlFmQMIexUcfJh7yNgX6uSuhfym9quW26wpb4k=; b=Zhe1Q9OEAN54EjkiDsTj5QdlA4sRUYwZ38aEnO7vlXgHXBZMzLqY4BTjtgu0ViObHV RQVbP6XAkpGFl8bobWSvqCixBBZ1+Kiq41TyjPeE0Z8DXWpLbZmzqJ+qg6Z66+sVFvl+ YYXmkaInHKZ5tIHYAkW7iMWGLg0w0RJZ5oYpKm3F6qMOM/YR4gE7WwF1dB8wb1l72ojp 2623W36NX5gsji8bkwbgE27OZE7I83627tbN8jsQm5xsvNEsl9CT/1CnM/L59ovc8evU h0Y/zg9iMv2PAWWHx48DOQA8r50ZCztkq8nJ8vpyHqfSJGr00BsMzh+s3sd20NoGAgEi Px/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id d7-20020a170902cec700b001c5c632aea4si17966122plg.217.2023.09.27.10.59.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 10:59:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9BCD48116E5B; Wed, 27 Sep 2023 09:14:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231182AbjI0QOV convert rfc822-to-8bit (ORCPT + 99 others); Wed, 27 Sep 2023 12:14:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230270AbjI0QOT (ORCPT ); Wed, 27 Sep 2023 12:14:19 -0400 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA93A91; Wed, 27 Sep 2023 09:14:18 -0700 (PDT) Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-57bc11c197aso830668eaf.1; Wed, 27 Sep 2023 09:14:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695831258; x=1696436058; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E1ahmo9waRUqjCTDTV6N3TPA6RbVuxWOLI3ShINewQQ=; b=tR7o3/xpvI3DyNjTFPiwxEmR/RP6ShPh8MNrF2m2WrwLPeupDP47bAaBKN2DRYsVCp s7sBy8uVnlURWsIWpbAN0oH08UOC0W/QDWBmFuuNAcZKx0XAsGPb5Vyo1FdHEYsRKiW2 Q+zxyILRYg1IAEyc7ICqsi4zFG2G6cGZ2cXcw2R7r7uHnjEuP2CGEsf0IuPP63DyVzAR zuRyEkawH2OrMMAkYmK5eOOmjt1kTpsOAHBnZPEjWX8NSYa6EAuk16ckz7vi+q+1v4Mg JwDhRABizYe96L4fhdVvbChkGWCwcDMokRYKNg+rcrOiNxrpTCj0f3Gp3mt0wCxA2n7r Nmgw== X-Gm-Message-State: AOJu0YysxsXtVmev/kwxdfPBl4vRHmgMtKv+cn1WQ+ssv80Z099NqZnG P0cZJEOlZ9yINQOHWImKdugOIDQYd/szXmeM/lA= X-Received: by 2002:a4a:ee18:0:b0:56e:94ed:c098 with SMTP id bd24-20020a4aee18000000b0056e94edc098mr3051244oob.0.1695831257895; Wed, 27 Sep 2023 09:14:17 -0700 (PDT) MIME-Version: 1.0 References: <1957441.PYKUYFuaPT@kreacher> <2590280.Lt9SDvczpP@kreacher> <9f1374db-f866-ff52-e86c-99fecee24d1b@linaro.org> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 27 Sep 2023 18:14:06 +0200 Message-ID: Subject: Re: [PATCH v1 07/13] thermal: gov_power_allocator: Use trip pointers instead of trip indices To: Daniel Lezcano Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Linux PM , LKML , Linux ACPI , Srinivas Pandruvada , Zhang Rui , Lukasz Luba Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 27 Sep 2023 09:14:31 -0700 (PDT) On Wed, Sep 27, 2023 at 5:46 PM Daniel Lezcano wrote: > > 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 OK Given that patches [01-05/13] are not controversial, I'll respon the governor patches into a separate series on top of them. I would much appreciate it if you could take a look at patch [10/13] and the remaining ACPi thermal patches in this series [11-13/13]. They don't depend on the governor changes.