All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shuah <shuah@kernel.org>
To: He Rongguang <herongguang@linux.alibaba.com>,
	trenn@suse.com, shuah@kernel.org, jwyatt@redhat.com,
	jkacur@redhat.com, wyes.karny@amd.com
Cc: linux-kernel@vger.kernel.org, shannon.zhao@linux.alibaba.com,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v3] cpupower: fix TSC MHz calculation
Date: Mon, 16 Dec 2024 14:00:54 -0700	[thread overview]
Message-ID: <5381389c-80bb-4c8d-9708-abc1aa9857ee@kernel.org> (raw)
In-Reply-To: <6084e3c9-921b-4450-97bd-51ec44c52c04@linux.alibaba.com>

On 12/11/24 19:14, He Rongguang wrote:
> Commit 'cpupower: Make TSC read per CPU for Mperf monitor' (c2adb1877b7)
> changes TSC counter reads per cpu, but left time diff global (from start
> of all cpus to end of all cpus), thus diff(time) is too large for a
> cpu's tsc counting, resulting in far less than acutal TSC_Mhz and thus
> `cpupower monitor` showing far less than actual cpu realtime frequency.
> 
> /proc/cpuinfo shows frequency:
> cat /proc/cpuinfo | egrep -e 'processor' -e 'MHz'
> ...
> processor : 171
> cpu MHz   : 4108.498
> ...
> 
> before fix (System 100% busy):
>      | Mperf              || Idle_Stats
>   CPU| C0   | Cx   | Freq  || POLL | C1   | C2
>   171|  0.77| 99.23|  2279||  0.00|  0.00|  0.00
> 
> after fix (System 100% busy):
>      | Mperf              || Idle_Stats
>   CPU| C0   | Cx   | Freq  || POLL | C1   | C2
>   171|  0.46| 99.54|  4095||  0.00|  0.00|  0.00
> 
> Fixes: c2adb1877b76 ("cpupower: Make TSC read per CPU for Mperf monitor")
> Signed-off-by: He Rongguang <herongguang@linux.alibaba.com>
> ---

Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git/log/?h=cpupower
to be included in my next pull request to Rafael.

thanks,
-- Shuah

      reply	other threads:[~2024-12-16 21:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12  2:14 [PATCH v3] cpupower: fix TSC MHz calculation He Rongguang
2024-12-16 21:00 ` Shuah [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5381389c-80bb-4c8d-9708-abc1aa9857ee@kernel.org \
    --to=shuah@kernel.org \
    --cc=herongguang@linux.alibaba.com \
    --cc=jkacur@redhat.com \
    --cc=jwyatt@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=shannon.zhao@linux.alibaba.com \
    --cc=trenn@suse.com \
    --cc=wyes.karny@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.