Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp94520pxb; Tue, 10 Nov 2020 21:17:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhNs77Fi5oP5stsbzwBVPWZd+Y0e1nbe4Ds4ubBU6kV9qhwNiuumERVW308D6dsWBr0z2m X-Received: by 2002:a17:906:198b:: with SMTP id g11mr22855687ejd.445.1605071833594; Tue, 10 Nov 2020 21:17:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605071833; cv=none; d=google.com; s=arc-20160816; b=U8JsOE/GAsnErXt8bO9TtqweDlHfrkgGVF/Chsp4jiMbcCt8V8RCynajnr3VFjf0pD TX0a2yH3CaGQj1hgF3EVcKm7u6yxaPjfCMN3lgINYiS9VVQ/iMGG8NOx9lOn1obVSFKu raNsc4fN+I+i85gRZM2AEnBovvz0uX/JSsDsxTaQf7+T5Xx0NZ5JeaDx2Mf/6HpqKxSS EskgHQym0AGqHJQH6iAWsHdzI/kRDzsEaUSuCJx77O7RjF9AdFMDEfu9Ua7lprlr4v/9 UkJvTcNcxbUkliCtNy2bqPu0ds/8TESEYrqrzBA4ERvdx7WjNmOF9DEh+qRPNo102+gt yQ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=lqk9gT/atveM9k+VRBlwrhLK1Fp317eifcLejbxW1B4=; b=E+T8N9t0rS/1q+H6vj0L9/Pr0GnoIkLNrch/D3U5yJuzIbz0qIMEggZwGklUvii7T5 0nSapafWRGopwhs9XBLd4XTBCsJfMEf0i3W1QEbYqyL1JD3ATjljhtgkNRyCmXQiyVKg 4D9N4wBM3mZ1VcB8ywXiWhlQvVtXF5BmfL+yAl5FYPK0JHLjGdgrlbPmJn30/DT7eiD3 6BrTTRZGpJll9uhpzZ0yq3ofnC4S9kj64m47fz69Eb5Z5Lgi3KoyC9V11F0phubMNUMw Kq/t4bzQd98UEe9wfnGqO4mAA4yHA/bc+qQ3PdisSgdVSc7JkqDZzszQBpiDhTyBXeET 910w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d8doHJA5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id uz28si614099ejb.599.2020.11.10.21.16.50; Tue, 10 Nov 2020 21:17:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d8doHJA5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1725983AbgKKFNz (ORCPT + 99 others); Wed, 11 Nov 2020 00:13:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbgKKFNy (ORCPT ); Wed, 11 Nov 2020 00:13:54 -0500 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DADBBC0613D4 for ; Tue, 10 Nov 2020 21:13:54 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id z3so889656pfb.10 for ; Tue, 10 Nov 2020 21:13:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lqk9gT/atveM9k+VRBlwrhLK1Fp317eifcLejbxW1B4=; b=d8doHJA55o0L8EcvDtUW7FdbIj7wmRAuJdFB9sYpHR3X60GC4fdmD5B+p8PWDbCnZc uDij5LmLbttmsg/m2JU0G8+BhgbbBl5I3ZOqfStpMAc92fIQrlPOTJUy3OH/4wHIpXky ZHquWIbRNQJyMbLwyPNTGRsVDHB42vgs7niAyqb0W7GSY3RMEVV5JbxQvQ4SiWp1TQW6 xm+jWul86uI7UFO0jNZB+KMkjynXGnxMcketYFCZc8NA8z3+T5YEcFf7qdCoL0YXnPBE xppjZVbWJAsRXwHPPIaTWuoYlUSCCnJFriuvFdIHV+WdXCRgHqP0pMLqH4rp/Tm5zuJX UkLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lqk9gT/atveM9k+VRBlwrhLK1Fp317eifcLejbxW1B4=; b=dn7cGsheODFFAgd9OyQBAVcjZ5g6p+zQkcQWMLR8CFUNJVqJlxoq2rSJ0Lieng1Nz5 v1Gp/tt3zSPRYtl/Tiude6/3YZRCX/RJyD+GJNu2g9bWDHyuvmDTKhXhxMRtHHDYziOH AMXUnOXs6FepL1mY2PoVKNv9EOA9nM4oKU8xuw+4twUhdOTUiD0bX2ugBqkP0z8blyQD UJgObpdcX3dKgWMeZTLZoM/odyiKHpUaSmB1SX1AMD7TRCWaAE7E8v4DDCY9DfV4ax3c 8cPAw8JhF5XeICc72O55WV/bafFX0GublbE4sYS3HsBzUlgGoS+5y5svH0RhRmigK0C8 908A== X-Gm-Message-State: AOAM532uJ/hTYFIpbgUs9QJd+DgMpj2bu9ZNpHpbKOnt4d9kOGYxNXi6 i2/mY6o+XwV9x3zr4wjPBdkYWA== X-Received: by 2002:a63:4747:: with SMTP id w7mr19848081pgk.56.1605071634450; Tue, 10 Nov 2020 21:13:54 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id v126sm828115pfb.137.2020.11.10.21.13.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 21:13:52 -0800 (PST) Date: Wed, 11 Nov 2020 10:43:50 +0530 From: Viresh Kumar To: Thomas Renninger Cc: Rafael Wysocki , Jonathan Corbet , linux-pm@vger.kernel.org, Vincent Guittot , Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: stats: Switch to ktime and msec instead of jiffies and usertime Message-ID: <20201111051350.qxevqcca5775h2xa@vireshk-i7> References: <0e0fb542b6f6b26944cb2cf356041348aeac95f6.1605006378.git.viresh.kumar@linaro.org> <1832747.5iOEhN7m9D@c100> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1832747.5iOEhN7m9D@c100> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10-11-20, 13:53, Thomas Renninger wrote: > Am Dienstag, 10. November 2020, 12:07:37 CET schrieb Viresh Kumar: > > The cpufreq and thermal core, both provide sysfs statistics to help > > userspace learn about the behavior of frequencies and cooling states. > > > > This is how they look: > > /sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state:1200000 399 > > > The results look like this after this commit: > > /sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state:1200000 3830 > > How would userspace know whether it's ms or 10ms? > > whatabout a new file with the same convention as cooling devices (adding ms): Keeping two files for same stuff is not great, and renaming the file breaks userspace ABI. I am not sure what's the right thing to do here. > > /sys/class/thermal/cooling_device0/stats/time_in_state_ms:state0 3888 > > /sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state_ms:1200000 3830 > > Somewhat off-topic, some ideas: > > I wonder how useful these stats still are. > CPU_FREQ_STAT is off on my system: I still use it. > config CPU_FREQ_STAT > bool "CPU frequency transition statistics" > help > Export CPU frequency statistics information through sysfs. > > If in doubt, say N. > > Iirc this was a module at former times? > > commit 1aefc75b2449eb68a6fc3ca932e2a4ee353b748d > Author: Rafael J. Wysocki > Date: Tue May 31 22:14:44 2016 +0200 > > cpufreq: stats: Make the stats code non-modular > > outlined 2 problems with cpufreq_stats being non-modular, but > also seem to fix them up: > ... and drop the notifiers from it > Make the stats sysfs attributes appear empty if fast frequency > switching is enabled... I already fixed this recently and stats don't appear empty for fast switch anymore. -- viresh