Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3417453ioa; Tue, 26 Apr 2022 03:20:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz23HWON4vgSSGkPKXs/XbD7XBdKsWKzMXruEQ6iWZuU7Z9odmG0q8uy0cJS89A9ZeqK7yB X-Received: by 2002:a17:907:168a:b0:6da:9177:9fdd with SMTP id hc10-20020a170907168a00b006da91779fddmr20775279ejc.757.1650968444122; Tue, 26 Apr 2022 03:20:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650968444; cv=none; d=google.com; s=arc-20160816; b=cCAS+VI2wQX56cLx81quEEvs4FSKffTwBgYRDna8c6DjZz1v1nJTq482HlYAM1pgLo vQXtp1wCuuBMyKHv632FnvTp4n3FD5sw6peCp41s3XGaBIFVpDvWcIBiUh76MMJD5pJS 4WdB/HMg0gVC/92zBRmtEhcyqNEq+zMQnhQk3Iw2cv+jkHQy+xqWifW2+rj/IrGXO58q +C0w6a5ttxTeDQRV2dvc7CQQpSDlbQ1SIVdb54pvJEG0RDa0N++sL/Y1n6/z/NOFJlPl qENNSTD9NytTDTLD0KMUJ6jBrp8vcSRNNtumrvVyE/+pokMVbtEBrKBaI8XCUDlLf46h ohvw== 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; bh=jYjfy1EJAUy+Ijh6DFNkXxfA/bXTnCBcfMoNMw+46sw=; b=R99Q8nxXxqKQ0xgj57AgNIynzZNxA6HPVxDMp+bZJ2F82xJrbod9AY8c1zuvJ13OEF wh1j/15qW1dEkjH6uaWYgb/Ju7bM/keqsDsWXIpSuDoKAA6tn6ZfWPVjKrWPpbx7oJe+ E/MxZWVqavWoN52/Hpw4+tqzO/rnAmKg8TESZqUI31Okp++ESHYzUJJAPc6eJ5aI3ZI3 NuoL/ss+WkrrHI538dUMTT5PC7MhyEa2Z823/4XsUFw4YLnCFpiydsJRCvid9z8PiZOl ISniF7OdHJl7EearMfEQzB045Kkgmxf33B7/DWGxaDoI2HM2MPv5QG4gA6GEq0EuEvHp aVgg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a056402520700b00418c2b5befdsi17057542edd.479.2022.04.26.03.20.19; Tue, 26 Apr 2022 03:20:44 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344262AbiDZHuI (ORCPT + 99 others); Tue, 26 Apr 2022 03:50:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343874AbiDZHuH (ORCPT ); Tue, 26 Apr 2022 03:50:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 70F95193F4; Tue, 26 Apr 2022 00:47:00 -0700 (PDT) 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 3AC2C23A; Tue, 26 Apr 2022 00:47:00 -0700 (PDT) Received: from [10.57.12.108] (unknown [10.57.12.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AC2743F73B; Tue, 26 Apr 2022 00:46:58 -0700 (PDT) Message-ID: Date: Tue, 26 Apr 2022 08:46:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC PATCH v3 0/5] Introduce Cpufreq Active Stats Content-Language: en-US To: Viresh Kumar Cc: linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, rafael@kernel.org, daniel.lezcano@linaro.org, amitk@kernel.org, rui.zhang@intel.com, amit.kachhap@gmail.com, linux-pm@vger.kernel.org References: <20220406220809.22555-1-lukasz.luba@arm.com> <20220426031125.ozaxwecwvuby6wo3@vireshk-i7> From: Lukasz Luba In-Reply-To: <20220426031125.ozaxwecwvuby6wo3@vireshk-i7> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On 4/26/22 04:11, Viresh Kumar wrote: > On 06-04-22, 23:08, Lukasz Luba wrote: >> Hi all, >> >> This is the 3rd version of patch set which tries to address issues which are >> due to missing proper information about CPU performance in time. >> >> The issue description: >> 1. "Cpufreq statistics cover the time when CPUs are in idle states, so they >> are not suitable for certain purposes, like thermal control." Rafael [2] >> 2. Thermal governor Intelligent Power Allocation (IPA) has to estimate power, >> for the last period, e.g. 100ms, for each CPU in the Cluster, to grant new >> power and set max possible frequency. Currently in some cases it gets big >> error, when the frequency of CPU changed in the middle. It is due to the >> fact that IPA reads the current frequency for the CPU, not aware of all >> other frequencies which were actively (not in idle) used in the last 100ms. >> >> This code focuses on tracking the events of idle entry/exit for each CPU >> and combine them with the frequency tracked statistics inside internal >> statistics arrays (per-CPU). In the old cpufreq stats we have one shared >> statistics array for the policy (all CPUs) and not take into account >> periods when each CPU was in idle. >> >> Sometimes the IPA error between old estimation signal and reality is quite >> big (>50%). > > It would have been useful to show how the stats hierarchy looks in userspace > now. > I haven't modify your current cpufreq stats, they are still counting total time (idle + running) for the given frequency. I think this is still useful for some userspace tools. These new proposed stats don't have such sysfs interface to read them. I don't know if userspace would be interested in this information (the running only time). IIRC Android uses bpf mechanisms to get this information to the userspace.