Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3138901lqt; Tue, 23 Apr 2024 11:18:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW+dfqbI8iMEE/4aiC6oVslfPu3DunyHknZkW9rb3C0NHpq1to449GHoyD+qTaQHBIwkgEsVHANSt08YJeZdTPh3643RbGX8ApHhWxLQg== X-Google-Smtp-Source: AGHT+IEAM6ytwEfBHIoemqTG55YUZ4NG1dCPX302VL3u45pdjMjn//+wMTUKXf1Uhzj98f6wKdfX X-Received: by 2002:a05:6a20:7283:b0:1a9:dcd9:9756 with SMTP id o3-20020a056a20728300b001a9dcd99756mr211334pzk.16.1713896338581; Tue, 23 Apr 2024 11:18:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713896338; cv=pass; d=google.com; s=arc-20160816; b=Do/la2T+JZIxf2gtD4ubcf76kUwETZmNsUivkKbKLQbg3ZvQaR/0FOXmZvUbriJDkd wPM8lbvyi2CeCnRKD6vdu0OS9zBwO0pjkW3zQqlAd7qChN9AmHtwoGrck1ji+7Sfl2yd ECfMO2YtjmYXuimCBU9AcGN16fpoiY0fkjMPwqSEWPIymxuSem0zPwOtdY66ke5lrcuT HYN1DIPS7T8NPxGPJpj7qIXJrbexEwMV1RLUlJ/oiOKuItBCv+lL81+AVJLDhR7qfBQB ExvyVLzkJRE0LFJQ0HeuZRurP2bgbSX+tIHlAGlhDeO45lD+PgZvMVCdjf0Lr4LgQ5E5 qMUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=8/A/SFsDF1B4BIbdUrsWZYTwEfomYPI1XjF48OGsmcI=; fh=j9frf5Y1HTQJVVgr/qsHPTkZn0jRkWCMQGI0w/my+9k=; b=ee3V4tWE9s+Z4Eaf3MlhFtr8ff3yhONdZ9iOlKc7GfEQGBlfB9bTNhYA5UtEwyZKdI usgKd+HpPbZxdm1XJO8VWWP58sAmbWnbItC4OOtmr24fdUvM9mFvN/mjTwx785SqkN+P RgMUvIx/R9z+TUg7MeT5Dgl2d5KhdXMjD3qX0dFC14t+tHy7/J4KF7bzfINsdkRDhGgn 3HGtx0e7YCZJdPxhZa9Xv65ZLRak8WJEBG/OnXXkLNPrfh+pKddbUYDpHLydHsv0kbp2 yzkT6h5+WuvFokdexE63b7WY17a452WeM7Ck5ayGViGrAHmo8YVltC35MiasdQmXh18G FIkQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WkDHqjiE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-155729-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155729-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c32-20020a631c20000000b005dbf4efa1f8si9720313pgc.852.2024.04.23.11.18.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 11:18:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155729-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WkDHqjiE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-155729-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155729-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 461CA294F9C for ; Tue, 23 Apr 2024 18:06:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC47313E3F2; Tue, 23 Apr 2024 18:05:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WkDHqjiE" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 098EF1420B3; Tue, 23 Apr 2024 18:05:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713895550; cv=none; b=VNfa603+sIGce/4FBocrkimrd+/w6LFjvG3ovg7bO5UDu5u6SQFAgNzZu4vubfIREJzhT1JnEbDCsLpi+0po4AKTh+RVWVZZlWjx9mPuzej2mq5jcQ5W/Q3JUGlKWloVOBDkaNnVzafF/VIrfSwq+nO45aIqlcE6TxGdHj0xvrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713895550; c=relaxed/simple; bh=OGMcGHaqmVBhYuFv0XCcX1mQzR2UG/wAjsLV5VmbwUI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=G+DdEU+AEViiqiKcoUVb3FLfIpgokpWGOglObbeILErporcoluqG+8CPDNwEbsNH7KzmuHuADpYt2OoLBcc3lYy4aea6vofxOI4FAzjhsuroS18kktu1CWqPuF9hEm6Dy9H5vFUJlQ6xtNHL1HdQjqmimXtA7X11A0lnHyUDFDc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WkDHqjiE; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8526FC2BD10; Tue, 23 Apr 2024 18:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713895549; bh=OGMcGHaqmVBhYuFv0XCcX1mQzR2UG/wAjsLV5VmbwUI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WkDHqjiE3LCkX3HPeTNDULGQ0DVIPnQl/X1zq8Aw/MBVnjMFOVxl3ARRK9bmWkvAW U0BlupYN2L8DjgJgUGOAVk7x2LUxcBv0xDo4VwabqNunS6+sVGDWwWEEALwaHmUqox M8KOVtS9SFnqyEbuUIbBdNfR4pgHPeyLsRa9IN+edz0oR2DlbOnoRnyzQmhjqwJPO+ 20i2Z1cxZSfuS0Bvy/nVywABRQL2OoE/vx+agEkCBxyzDdgawrLKFOCpNDDAM3ddM3 ZK+wneHy9SkQY9UOBCp8KzcIYCNWn8++17H99GKJ2xq2Hwm0qJXVemkzuO5JzUZ+jb cueC0bXubAI9g== Received: by mail-oo1-f51.google.com with SMTP id 006d021491bc7-5acdbfa7a45so1850905eaf.2; Tue, 23 Apr 2024 11:05:49 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWnzS3ct8FM6VkTqPOKolee1bv2qctRhUqpkHk4zExoWj2Ac3C5TRa9kwBXn0RVqb/n3ppicpN+8LKhJS4SzpYgdktufdiG5RfT8rr7nUiMCJnv0LqDHMR4VwmUb3OwapR+9/CxogY= X-Gm-Message-State: AOJu0Yyo3Pva20DbbRmtj50IaSU8bcAKIL8luWvt61dTpQOsy+z1N4JG yA70HHzHgU5EQMn0zkUgm8Se0jg1AFU/ctIx2WOthmxL6B0O/XzRq6WfAcjmJY7nI95v3omW8dI 0VM8Spk6UdmqHma4hFrwbiMNGmqU= X-Received: by 2002:a4a:ee8d:0:b0:5aa:6b2e:36f0 with SMTP id dk13-20020a4aee8d000000b005aa6b2e36f0mr126873oob.0.1713895548914; Tue, 23 Apr 2024 11:05:48 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <13515747.uLZWGnKmhe@kreacher> <1913649.CQOukoFCf9@kreacher> <8e26c3cb-1283-4561-95aa-30432f1d13ee@linaro.org> <33cafcb3-af9c-4058-b6b6-4e5aab6e21cb@linaro.org> In-Reply-To: <33cafcb3-af9c-4058-b6b6-4e5aab6e21cb@linaro.org> From: "Rafael J. Wysocki" Date: Tue, 23 Apr 2024 20:05:37 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 07/16] thermal: gov_power_allocator: Eliminate a redundant variable To: Daniel Lezcano Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Linux PM , LKML , Lukasz Luba , Srinivas Pandruvada Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 23, 2024 at 8:00=E2=80=AFPM Daniel Lezcano wrote: > > On 23/04/2024 19:54, Rafael J. Wysocki wrote: > > On Tue, Apr 23, 2024 at 7:35=E2=80=AFPM Daniel Lezcano > > wrote: > >> > >> On 10/04/2024 18:12, Rafael J. Wysocki wrote: > >>> From: Rafael J. Wysocki > >>> > >>> Notice that the passive field in struct thermal_zone_device is not > >>> used by the Power Allocator governor itself and so the ordering of > >>> its updates with respect to allow_maximum_power() or allocate_power() > >>> does not matter. > >>> > >>> Accordingly, make power_allocator_manage() update that field right > >>> before returning, which allows the current value of it to be passed > >>> directly to allow_maximum_power() without using the additional update > >>> variable that can be dropped. > >>> > >>> Signed-off-by: Rafael J. Wysocki > >>> --- > >> > >> The step_wise and the power allocator are changing the tz->passive > >> values, so telling the core to start and stop the passive mitigation t= imer. > >> > >> It looks strange that a plugin controls the core internal and not the > >> opposite. > >> > >> I'm wondering if it would not make sense to have the following ops: > >> > >> .start > >> .stop > >> > >> .start is called when the first trip point is crossed the way up > >> .stop is called when the first trip point is crossed the way down > >> > >> - The core is responsible to start and stop the passive mitigation = timer. > >> > >> - the governors do no longer us tz->passive > >> > >> The reset of the governor can happen at start or stop, as well as the > >> device cooling states. > > > > I have a patch that simply increments tz->passive when a passive trip > > point is passed on the way up and decrements it when a passive trip > > point is crossed on the way down. It appears to work reasonably well. > > Does it make the governors getting ride of it ? Or at least not changing > its value ? Not yet, but I'm going to update it this way. The governors should not mess up with tz->passive IMV.