Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2203981lqt; Mon, 22 Apr 2024 04:49:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWrIeBZSzZJCrK5b5iRmki9kiZYCjEAzrGICoxCmujBbyhxQC9V+WnuGsGrQDUMLL76j/0v9Powpj+cBi4mlPwvNq30OFPLG1x0gjD0sA== X-Google-Smtp-Source: AGHT+IE8u1apkaCjR/S6zP3uog607fO5R2g/ZdaG/L5sZFHdICk74l/LQajiGxnZcxT9AWYpIVjs X-Received: by 2002:a17:903:2341:b0:1e2:ac38:2674 with SMTP id c1-20020a170903234100b001e2ac382674mr12549825plh.46.1713786579887; Mon, 22 Apr 2024 04:49:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713786579; cv=pass; d=google.com; s=arc-20160816; b=GijoP8ueGfw7Cf1rbHjKAJijo/H1XHPVHv1IOoefT0rXTeYqp5Ky/2pg8pzFINttp+ QhsmXjNYBYbn72lpbKeyToLCSaKSHv6jnpCReH9MbO9DY62I5ylyXBZsFvdThtj10cPw /y7nhCdpls58in2Z9ph8JME0IVeKbWiD1EoCjHG4liP7v15jPyZH681Ny7hNPCl50/B2 mMgvyxCkZSnDv2YtEZYhdowiY6YLW9DpjP5S7SEaqTlITMNMuX5/bV6Xfz7OfY9DFf46 ftTU61pzgxRlYVq/hvPhvGPigXlwOg9+nq8UF3gOkw4dIs9l/9v4Y6k2zVCycZUVxJeF t9aw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=FMe4bUqC3ZWq7ikjx4vZOKD7Rj68UxGxTzvnBJURCG0=; fh=wOhU+RfGR6AETSQpmLn4c4kjE8Q9JmYwekkxN+5ihyo=; b=MBFBtVCb9PEvNkitUqB9kaKfnuEnDenOS2osdPNBd7BcPf2njAhkU9Z4qSylMe9Gwt nBpJBzOIgXqsWJ4brf9wOKWitZgaUz/wi4r83S70pVKvT5ag6zmWupeC871MEEjmnxDW POIf+LgexL9YdqhbRhDqSxgjL6+FC9E2ndrCSwYD4/SnPmiZ63nc82r4FxfqoCDJn/hV fDqgBJeWpx/UYQGm59zZ5EoveRp5kJulZhMgJl7TU9uDM2LdJObQpChnVrl6bvAtAT3F qIqikK6kC9mmQxvgQ9Cil75nEu5G3zMY8MolmoPiIXdGHcv/ioMU9GKCyw6Po166Xwuq qLxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-153293-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153293-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j10-20020a170902da8a00b001e3cd26cef3si7809036plx.503.2024.04.22.04.49.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 04:49:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153293-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-153293-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153293-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4945AB22197 for ; Mon, 22 Apr 2024 11:37:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9385146A6F; Mon, 22 Apr 2024 11:37:12 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB47D1465A2; Mon, 22 Apr 2024 11:37:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713785832; cv=none; b=lORtStMAnGJ7eOBC0SDj51pD+Z5HdOPkKbuDRElNTRG5cUnVnrSg1Wsf8iF2uiyHsWBmdvbbOqai601/bYf0y0XAEWqAkpkEp79tKRLUB4xX/E0kW8RrumFV9NPFIlgiMlt8RlLi9eT9avQKvUDiw5icKe31eo4KdSdXrehh/PM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713785832; c=relaxed/simple; bh=giz8ndf4KlmCclo1HmturdVYzZOBqqSQfzj8LZLKAiA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oOEOvIVHQDGzybp8zdf6vhHnbDFaDzSJ+AYphN1jc0y5hef7JMFjQs9pcTgdTLcQPHLKI4+3quRsyBsmT1ddTlLUKRzGcdkImn0kuuHndLDtj+Iq9hX8CIuiDMTwA5442OXNrTLwtQvv7Hqzz9i9dczR6EaxsF785NbCLPY5ito= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 5AD02339; Mon, 22 Apr 2024 04:37:38 -0700 (PDT) Received: from [10.57.75.149] (unknown [10.57.75.149]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 30D6C3F7BD; Mon, 22 Apr 2024 04:37:09 -0700 (PDT) Message-ID: <3a8f1978-c5df-40d6-91ca-276431bb01e1@arm.com> Date: Mon, 22 Apr 2024 12:37:18 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 0/3] thermal/debugfs: Fix and clean up trip point statistics updates To: "Rafael J. Wysocki" Cc: LKML , Linux PM , "Rafael J. Wysocki" , Daniel Lezcano References: <4918025.31r3eYUQgx@kreacher> Content-Language: en-US From: Lukasz Luba In-Reply-To: <4918025.31r3eYUQgx@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Rafael, On 4/17/24 14:07, Rafael J. Wysocki wrote: > Hi Everyone, > > The first patch in this series addresses the problem of updating trip > point statistics prematurely for trip points that have just been > crossed on the way down (please see the patch changelog for details). > > The way it does that renders the following cleanup patch inapplicable: > > https://lore.kernel.org/linux-pm/2321994.ElGaqSPkdT@kreacher/ > > The remaining two patches in the series are cleanups on top of the > first one. > > This series is based on an older patch series posted last week: > > https://lore.kernel.org/linux-pm/13515747.uLZWGnKmhe@kreacher/ > > but it can be trivially rebased on top of the current linux-next. > > Thanks! > > > I've checked this patch patch set on top of your bleeding-edge which has thermal re-work as well. The patch set looks good and works properly. Although, I have found some issue in this debug info files and I'm not sure if this is expected or not. If not I can address this and send some small fix for it. When I read the cooling device residency statistics, I don't get updates for the first time the state is used. It can only be counted when that state was known and finished it's usage. IMO it is not the right behavior, isn't it? Experiment: My trip points are 70degC and 75degC and I'm setting emulated temperature to cross them and get cooling states 1 then 0. As you can see the statistics counter only starts showing value after after trip crossing down. ------------------------------------8<----------------------------------- root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency root@arm:~# root@arm:~# root@arm:~# echo 71000 > /sys/class/thermal/thermal_zone0/emul_temp root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency root@arm:~# echo 76000 > /sys/class/thermal/thermal_zone0/emul_temp root@arm:~# root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency 0 518197 root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency 0 518197 root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency 0 518197 root@arm:~# echo 71000 > /sys/class/thermal/thermal_zone0/emul_temp root@arm:~# root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency 0 520066 1 17567 root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency 0 522653 1 17567 root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency 0 526151 1 17567 root@arm:~# echo 66000 > /sys/class/thermal/thermal_zone0/emul_temp root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency 0 537366 1 17567 root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency 0 544936 1 17567 root@arm:~# cat /sys/kernel/debug/thermal/cooling_devices/0/time_in_state_ms State Residency 0 556694 1 17567 root@arm:~# ------------------------------->8---------------------------------------- Please let me know what do you think about that behavior. Regards, Lukasz