Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp223804pxb; Wed, 11 Nov 2020 01:55:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZ4NC3t6URxY8EqFW7N8TLrgUzpSZ1GA0BPe9kcHKA5V6zAMuZ+e3zx4r4LHDt+4nYg7Fc X-Received: by 2002:a17:906:d8ce:: with SMTP id re14mr23660453ejb.275.1605088509991; Wed, 11 Nov 2020 01:55:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605088509; cv=none; d=google.com; s=arc-20160816; b=teWEMfvSvskFQlr18BDhym2WOLPjOG80ksygZgAV+6UD7gDVUvOgej/uJYddXY0tb/ SpwAJKTcJvK0MxjVQwWvYiNiUsrB6Rx9jr4CfAFQb95XjHi9yuv61/5oGMX4aHABtgb4 oOVD7hB2mwugKBAYLLUu6YqyHX1xdhVWOt90ebA03Jgvo7DWRT9ctZargZlCRnIMgBE/ c6bGkt4KaN9+RgS/PQqpKRmLdD41Moq4riAo8gUTKKrtmK1ywWgFmPb1L6BR6cKqHtrN lEk4zMxFvz89ySrJa6KVQcK58U4TvofpjeVS7t8Uxb8wU1/dHdAq3o1DjIPwBwePDTZz FjEg== 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=HRhA/9/dWDo5po8jcoZ8JRpSSGgd2ewUSLF6VW3aj9I=; b=H1VQsoZRhsu3EADSk2yRkx5t31c2norEBZbuh5qdi/SXdjS/73sdsO5vPrC4T0Xylz 0znm5MJRz9GKXNMDQlMcB9EvsdAqPRseF1HXfRwHMFF7OiT0ydGAkp+NUtNThHWwcGCu Lz5vjBnBlm5FQ4Q/WpEiCz4ZZg04+WlvQ7Gw6xFeJqCA83UvRyNXsAF8dtBlyUrj+bZ0 mIizPlQcq13K8Zu552/G6IFE88u+GkdDBDKh/9xh+O40MQ7e2aSZ9cvF7Yxu4suPuPGt RCKbDO9kHws1Nfho6ZM2Tp0N6OPw7hFwrwMQo8F9oSQOZqUQ3sfFfCsZCaDKAR3wMnMl gCpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wiBeiEDm; 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 z8si857315ejr.523.2020.11.11.01.54.44; Wed, 11 Nov 2020 01:55:09 -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=wiBeiEDm; 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 S1726567AbgKKJvQ (ORCPT + 99 others); Wed, 11 Nov 2020 04:51:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726534AbgKKJvM (ORCPT ); Wed, 11 Nov 2020 04:51:12 -0500 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 006B5C0613D6 for ; Wed, 11 Nov 2020 01:51:10 -0800 (PST) Received: by mail-pj1-x1041.google.com with SMTP id r9so445237pjl.5 for ; Wed, 11 Nov 2020 01:51:10 -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=HRhA/9/dWDo5po8jcoZ8JRpSSGgd2ewUSLF6VW3aj9I=; b=wiBeiEDmShIVDqF3zPzEIH56Oj+TQiU3sHEjdStNgmjYioOs8x0j89pLGPE1S1pPdB VnPYf6QEgtHeW3kBOyGLT/LbjWS1GdXEjrwaKdFyttpKd2dUcHKzlcyPMqOBi8KHTFcd 4p19jmoq2bdFj8qj0Ujm6zyf8C3ADjOGjIJsEHl93DbvVi67tnFJMpIflgki3PyUwgS3 7LrU75tZGlaTpPZb5sIteCiLUT0kXbddaVQAVlh25Q1Y2ZOOiiullfFxzsp7tePF8Fnk YxFGcZSvK9U8UOeOfT2Jo5YvxvDfvFNcAz6BM5AwS30Yuxu49Gqj3+XgpQSooJkK5CTH eHCg== 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=HRhA/9/dWDo5po8jcoZ8JRpSSGgd2ewUSLF6VW3aj9I=; b=qfq+gCcBYCdT3e2BnGZRpBVNUojsjJlIGUyIzNDvVimAyXZKM7okX1W2RizrAa/e4f nuBOrm8IHXX7AO2HoGbjaCV/gb7n1KjCSK7g2L1WT7Mj2v4UQOD3IX2bWvsaui3Hiwtb JrcaKq3H6AOciKuL9ms8IhAntgTArdED3byu0/wc3Lxmh0B6eAqlNidTUAyUkUwxCsPo y9cewcSWoYPPOImYMp1HgzWBzSy2bjuvc/cwj5oSf0hJyRpuVyP2TDIy9lvStnwKL1aJ MOJRpD1/AsbrqcrMfhYavVMtdTCzcD6jKiJtmZoxWdWRN7MnPi4h/F+k1gDYyp4GsFZf 8Kqg== X-Gm-Message-State: AOAM531mCWcq9U7tuE5MOD/GSOF4LnFfj4omHXvJ6oo4Htr3Crvvp2f+ uYCqcsNPoyKv/YvEL0RVIIShNA== X-Received: by 2002:a17:90b:1741:: with SMTP id jf1mr3047963pjb.144.1605088270466; Wed, 11 Nov 2020 01:51:10 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id c3sm1863531pjv.27.2020.11.11.01.51.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Nov 2020 01:51:09 -0800 (PST) Date: Wed, 11 Nov 2020 15:21:07 +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: <20201111095107.fanba37rgls536xn@vireshk-i7> References: <0e0fb542b6f6b26944cb2cf356041348aeac95f6.1605006378.git.viresh.kumar@linaro.org> <1832747.5iOEhN7m9D@c100> <20201111051350.qxevqcca5775h2xa@vireshk-i7> <2047155.4hzcE6bcFl@c100> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2047155.4hzcE6bcFl@c100> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11-11-20, 09:13, Thomas Renninger wrote: > Am Mittwoch, 11. November 2020, 06:13:50 CET schrieb Viresh Kumar: > > 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? > > Again: > How would userspace know whether it's ms or 10ms? Yeah, I understand the problem you are pointing at. > > > 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. > > No exactly the other way around: > - Renaming, breaks the userspace ABI. > - Two files would be the super correct way to go: Yes, but then this is just some stats which a very limited number of people should be using and so ... > - Deprecate the old file and keep the 10ms around for some years > ./Documentation/ABI/obsolete > - Add the new interface and document it in: > ./Documentation/ABI/testing > > As this is about a minor cpufreq_stat debug file, it is enough if > you rename to: > > /sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state_ms ... I agree about this. Just rename the file accordingly. Which will also make sure that everyone follows that something got changed in the kernel. > > I already fixed this recently and stats don't appear empty for fast > > switch anymore. > > Then cpufreq_stats could be a module again? No, not really. This is some code that needs to get called from cpufreq core, without any notifiers and as fast as possible as we may be in scheduler's hot path. So the module thing isn't going to work now. -- viresh