Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8286028rwd; Tue, 20 Jun 2023 12:55:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7RHJl93ikXJtwNBgoTQ/GfDBI/JpL0vPkPHSXl72sg2mRWDhKjqxtIA5BgFwvpa7wivxkU X-Received: by 2002:a05:6808:2111:b0:39e:cf4d:f5ab with SMTP id r17-20020a056808211100b0039ecf4df5abmr6959812oiw.7.1687290947767; Tue, 20 Jun 2023 12:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687290947; cv=none; d=google.com; s=arc-20160816; b=W9WmHk8eJoiVrictSPg52RCjJcvJ4Fac+cQ/bot6E/n9TrTs8Oio4oskUXUgt5tkiM I7OBZEF7p5HDM0ROqPeXY7JDFMJdZthCYvU8NiPrdwCn5rb06zHiq/GGlxLHCcuNU1MZ AB6Y7k+qRWkChk/+gGXCZaXjRkl6O+lWa1L4ysRQ3CzCdR9y+DEX/7fIfZOquCPncOty MRAqkQBWXJO2PGQhzO9V5HR8PKQmNwgqAre1EQm7vZYpDQEJxNXLcHL77Rba2jvcTbaW nsh9+1l21kD3VQObTgtUnuHFbJfIxO/3SnGIZsJaPhYoPr6LFRG96fcj1Dg9xEMI9qls p6Aw== 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=/x5qK0JZg5lh7rsy4InWDjLtme8s/Ys8njFfDN5MMo0=; b=rEok4QPFAfuWe5vr6qsSIB2tW2R8RXCK5XHO2DwSwkW9mRlg2FTm3qhjnOSst4qojT t6owV32kw7E/qpwfNnS3BgzZP7PXKPgl6Gc7//Sb3us0PPAt9lFpf1dYFXRvfIz/gN/6 hP6zaACuhbO+WKW317NEefta6DFcpFKKUg/PScJfd289f3XahaubqOdVZz6y5H9AB242 KOcCGlQQf1sfWIUEhPFX/n1fVGuoPZhxUDJjifccMz+bP59DxopoXFWvpfl3i4qga6AG yGfrS0WS7fbSMt6A+6H9z4H+DTpeMmbNME/CzYYZkD31YD6gUEzMZChTa0RzatWsvG7j 76ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RGsFwD7l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p3-20020a17090a74c300b00259b4cb4bcfsi10302562pjl.37.2023.06.20.12.55.33; Tue, 20 Jun 2023 12:55:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RGsFwD7l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230150AbjFTTFW (ORCPT + 99 others); Tue, 20 Jun 2023 15:05:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230344AbjFTTFU (ORCPT ); Tue, 20 Jun 2023 15:05:20 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A21C170C for ; Tue, 20 Jun 2023 12:05:10 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f907f311ccso41546395e9.1 for ; Tue, 20 Jun 2023 12:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687287909; x=1689879909; 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=/x5qK0JZg5lh7rsy4InWDjLtme8s/Ys8njFfDN5MMo0=; b=RGsFwD7lYdd63uR6B4oIifnq780QcXAQQ3iRbMWCAm21RMd28pCE+5e7YYvpWcQU6A RcFLqkOqVYfbRGOYjiyBz3TgvZ+hNuaMLwzoDt6CmY0q7GSYyhmf+1KSp+KdeYlad+/n HYTFlxUxvPvMhiflguPOkvHb97Uw0FeVFrRUoqioKvEbKwzST4194kM0xBOMbDv9pyRm GAmmcAzKzaoHtKwYIXI8eoL6pFR8qdH3wnpbVIxhcc+OOYF9l/nnwHN+D7xWG1OhhHVH 4LYL6Mx8fDGB1iqzj29zP439GC+cbGDa9r7UwL8TX2H25xs4VekxzjHeIdVqBw0fw6e+ vqXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687287909; x=1689879909; 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=/x5qK0JZg5lh7rsy4InWDjLtme8s/Ys8njFfDN5MMo0=; b=kKP5CSB/B/JS7lft2JPmLwuBeTDunHM3U0we5hJ/EoxhS698zHru7KOQCho+pIsYVp xhABEm/Llv7DpXd2tKNOvKyVWZgRbET/jpaQ6C1pzjKfonjG/k+yYCTAnOQfxfV2Qe8h IQDWzeF/roqTL0bzzQQyiQGcaYS/JmaP/5b8MFNyfgEJi+GgGIPesM1500AuaqOsvlll 1l5Nh1HlXQsDXKMujSaySHNB5FZOMZRrg6H4huCEgHXzM5A2TsyLhaws9o5oKxjtEhwa fw+VCTFahHLHQ+N/rjIBfY/rscCxdTHgg6QnsqJ5kmAUCuBFuE4hFhsjRBFXB9gJc5Uo UD/A== X-Gm-Message-State: AC+VfDyo5Nkj3tWFrUoQlhEHJQL3lVlKNMWX0QCV3C0AnvtKshMqpF+e gp4ErfOBDg9IIsWTdUW1+boFtA== X-Received: by 2002:adf:ea8b:0:b0:2f8:3225:2bc2 with SMTP id s11-20020adfea8b000000b002f832252bc2mr10313053wrm.41.1687287908640; Tue, 20 Jun 2023 12:05:08 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:fae4:142d:36ed:5151? ([2a05:6e02:1041:c10:fae4:142d:36ed:5151]) by smtp.googlemail.com with ESMTPSA id f7-20020adff8c7000000b0030e6096afb6sm2606283wrq.12.2023.06.20.12.05.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Jun 2023 12:05:08 -0700 (PDT) Message-ID: Date: Tue, 20 Jun 2023 21:05:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 0/7] thermal: enhancements on thermal stats Content-Language: en-US To: Eduardo Valentin , eduval@amazon.com, linux-pm@vger.kernel.org Cc: "Rafael J. Wysocki" , Amit Kucheria , Zhang Rui , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230519032719.2581689-1-evalenti@kernel.org> From: Daniel Lezcano In-Reply-To: <20230519032719.2581689-1-evalenti@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 Hi Eduardo, On 19/05/2023 05:27, Eduardo Valentin wrote: > Hello Rafael and Daniel > > After a long hiatus, I am returning to more frequent contributions > to the thermal subsystems, as least until I drain some of the > commits I have in my trees. > > This is a first series of several that will come as improvements > on the thermal subsystem that will enable using this subsystem > in the Baseboard Management Controller (BMC) space, as part > of the Nitro BMC project. To do so, there were a few improvements > and new features wrote. > > In this series in particular, I present a set of enhancements > on how we are handling statistics. The cooling device stats > are awesome, but I added a few new entries there. I also > introduce stats per thermal zone here too. From my POV, that kind of information belongs to debugfs. sysfs is not suitable for that. The cdev stats are a total mess because of the page size limitation of sysfs and the explosion of the combination when there are a large number of states (eg. display is 1024 cooling device states resulting in a matrix of 1024 x 1024, so more than 4MB of memory). For the record, I'm working on such of statistics [1][2], and optimized this cooling device statistics in order to get ride of the existing sysfs cdev stats. Actually, all the stats rely on the mitigation episodes. However, for that we need to correctly identify when they begin and when they end. We can have mitigation episode inside mitigation episode (eg. passive mitigation@trip0 and active mitigation@trip1). This is not working today because the trip point detection is incorrect, thus the mitigation episodes are also incorrect, consequently the stats are de facto incorrect. There is more details at [3] but the change assumes the trip points are ordered in the ascending order which is wrong, that is why it was not merged. The mitigation works but the detection is fuzzy, so the math is inaccurate and as we are in the boundaries of a temperature limit, the resulting statistics do not show us the interesting information to optimize the governors when they are not totally inconsistent. All the work around the generic trip points is to fix that. There is a proposal at LPC to add statistic/debug information for thermal, may be you can participate so we join our efforts? -- Daniel [1] https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git/log/?h=thermal/trip-crossed%2bdebugfs [2] https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git/log/?h=thermal/debugfs-v2 [3] https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git/commit/?h=thermal/trip-crossed%2bdebugfs&id=7d713a9128ad9a153de9c3f5b854c6f1acfb3064 -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog