diff mbox series

tools/power turbostat: Fix Bzy_MHz calculation equation

Message ID TYCP286MB214616F6AE3E088C5D781A2EC6C8A@TYCP286MB2146.JPNP286.PROD.OUTLOOK.COM (mailing list archive)
State Accepted, archived
Delegated to: Len Brown
Headers show
Series tools/power turbostat: Fix Bzy_MHz calculation equation | expand

Commit Message

Peng Liu Oct. 7, 2023, 5:46 a.m. UTC
From: Peng Liu <liupeng17@lenovo.com>

To calculate Bzy_MHz, TSC_delta should multiply APERF_delta instead
of dividing it.

Signed-off-by: Peng Liu <liupeng17@lenovo.com>
---
 tools/power/x86/turbostat/turbostat.8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peng Liu Oct. 30, 2023, 3:11 a.m. UTC | #1
Ping

On 2023/10/7 13:46, Peng Liu wrote:
> From: Peng Liu <liupeng17@lenovo.com>
>
> To calculate Bzy_MHz, TSC_delta should multiply APERF_delta instead
> of dividing it.
>
> Signed-off-by: Peng Liu <liupeng17@lenovo.com>
> ---
>   tools/power/x86/turbostat/turbostat.8 | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8
> index 8f08c3fd498d..1ba6340d3b3d 100644
> --- a/tools/power/x86/turbostat/turbostat.8
> +++ b/tools/power/x86/turbostat/turbostat.8
> @@ -370,7 +370,7 @@ below the processor's base frequency.
>   
>   Busy% = MPERF_delta/TSC_delta
>   
> -Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
> +Bzy_MHz = TSC_delta*APERF_delta/MPERF_delta/measurement_interval
>   
>   Note that these calculations depend on TSC_delta, so they
>   are not reliable during intervals when TSC_MHz is not running at the base frequency.
Doug Smythies Nov. 2, 2023, 3:31 p.m. UTC | #2
Hi Peng and Wyes,

Just for your information about your recent "ping"s about your turbostat patches:

Please be aware that there is rarely any reply. There tends to be about 2 turbostat updates released per year. Your patches are in patchworks [1], as are some others, including an old one of mine from 2023.04.03
Eventually there will be an update, and hopefully it will include all our patches.

[1] https://patchwork.kernel.org/project/linux-pm/list/?series=&submitter=&state=&q=&archive=&delegate=107

... Doug

On 2023.10.29 08:12 Peng Liu wrote:

> Ping
>
> On 2023/10/7 13:46, Peng Liu wrote:
>> From: Peng Liu <liupeng17@lenovo.com>
>>
>> To calculate Bzy_MHz, TSC_delta should multiply APERF_delta instead
>> of dividing it.
>>
>> Signed-off-by: Peng Liu <liupeng17@lenovo.com>
>> ---
>>   tools/power/x86/turbostat/turbostat.8 | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8
>> index 8f08c3fd498d..1ba6340d3b3d 100644
>> --- a/tools/power/x86/turbostat/turbostat.8
>> +++ b/tools/power/x86/turbostat/turbostat.8
>> @@ -370,7 +370,7 @@ below the processor's base frequency.
>>   
>>   Busy% = MPERF_delta/TSC_delta
>>   
>> -Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
>> +Bzy_MHz = TSC_delta*APERF_delta/MPERF_delta/measurement_interval
>>   
>>   Note that these calculations depend on TSC_delta, so they
>>   are not reliable during intervals when TSC_MHz is not running at the base frequency.
Peng Liu Nov. 3, 2023, 1:55 a.m. UTC | #3
Hi Doug,

Thanks for your information. I wonder whether a submitter will be notified if his/her patch is not accepted. Can I assume that my patch is accepted if no reply is received?

Regards,
Peng

On 2023/11/2 23:31, Doug Smythies wrote:
> Hi Peng and Wyes,
>
> Just for your information about your recent "ping"s about your turbostat patches:
>
> Please be aware that there is rarely any reply. There tends to be about 2 turbostat updates released per year. Your patches are in patchworks [1], as are some others, including an old one of mine from 2023.04.03
> Eventually there will be an update, and hopefully it will include all our patches.
>
> [1] https://patchwork.kernel.org/project/linux-pm/list/?series=&submitter=&state=&q=&archive=&delegate=107
>
> ... Doug
>
> On 2023.10.29 08:12 Peng Liu wrote:
>
>> Ping
>>
>> On 2023/10/7 13:46, Peng Liu wrote:
>>> From: Peng Liu <liupeng17@lenovo.com>
>>>
>>> To calculate Bzy_MHz, TSC_delta should multiply APERF_delta instead
>>> of dividing it.
>>>
>>> Signed-off-by: Peng Liu <liupeng17@lenovo.com>
>>> ---
>>>    tools/power/x86/turbostat/turbostat.8 | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8
>>> index 8f08c3fd498d..1ba6340d3b3d 100644
>>> --- a/tools/power/x86/turbostat/turbostat.8
>>> +++ b/tools/power/x86/turbostat/turbostat.8
>>> @@ -370,7 +370,7 @@ below the processor's base frequency.
>>>    
>>>    Busy% = MPERF_delta/TSC_delta
>>>    
>>> -Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
>>> +Bzy_MHz = TSC_delta*APERF_delta/MPERF_delta/measurement_interval
>>>    
>>>    Note that these calculations depend on TSC_delta, so they
>>>    are not reliable during intervals when TSC_MHz is not running at the base frequency.
Wyes Karny Nov. 3, 2023, 4:48 a.m. UTC | #4
On 02 Nov 08:31, Doug Smythies wrote:
> Hi Peng and Wyes,
> 
> Just for your information about your recent "ping"s about your turbostat patches:
> 
> Please be aware that there is rarely any reply. There tends to be about 2 turbostat updates released per year. Your patches are in patchworks [1], as are some others, including an old one of mine from 2023.04.03
> Eventually there will be an update, and hopefully it will include all our patches.

Thanks Doug for the information.

Regards,
Wyes
> 
> [1] https://patchwork.kernel.org/project/linux-pm/list/?series=&submitter=&state=&q=&archive=&delegate=107
> 
> ... Doug
> 
> On 2023.10.29 08:12 Peng Liu wrote:
> 
> > Ping
> >
> > On 2023/10/7 13:46, Peng Liu wrote:
> >> From: Peng Liu <liupeng17@lenovo.com>
> >>
> >> To calculate Bzy_MHz, TSC_delta should multiply APERF_delta instead
> >> of dividing it.
> >>
> >> Signed-off-by: Peng Liu <liupeng17@lenovo.com>
> >> ---
> >>   tools/power/x86/turbostat/turbostat.8 | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8
> >> index 8f08c3fd498d..1ba6340d3b3d 100644
> >> --- a/tools/power/x86/turbostat/turbostat.8
> >> +++ b/tools/power/x86/turbostat/turbostat.8
> >> @@ -370,7 +370,7 @@ below the processor's base frequency.
> >>   
> >>   Busy% = MPERF_delta/TSC_delta
> >>   
> >> -Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
> >> +Bzy_MHz = TSC_delta*APERF_delta/MPERF_delta/measurement_interval
> >>   
> >>   Note that these calculations depend on TSC_delta, so they
> >>   are not reliable during intervals when TSC_MHz is not running at the base frequency.
>
Len Brown Nov. 28, 2023, 1:39 a.m. UTC | #5
Peng Liu,
Thanks for the close read of the documentation, and the patch.
I've applied it, though I re-wrote the commit message (below) to make
it clear it is a documentation fix, as the code was already correct.

thanks,
-Len

ps. I would have replied to your original e-mail, but there was a
period where gmail dropped mail due to space limitations.
No worries, as Doug said, everything is in patchwork.


    tools/power turbostat: Fix Bzy_MHz documentation typo

    The code calculates Bzy_MHz by multiplying TSC_delta *
APERF_delta/MPERF_delta
    The man page erroneously showed that TSC_delta was divided.

On Thu, Nov 2, 2023 at 11:31 AM Doug Smythies <dsmythies@telus.net> wrote:
>
> Hi Peng and Wyes,
>
> Just for your information about your recent "ping"s about your turbostat patches:
>
> Please be aware that there is rarely any reply. There tends to be about 2 turbostat updates released per year. Your patches are in patchworks [1], as are some others, including an old one of mine from 2023.04.03
> Eventually there will be an update, and hopefully it will include all our patches.
>
> [1] https://patchwork.kernel.org/project/linux-pm/list/?series=&submitter=&state=&q=&archive=&delegate=107
>
> ... Doug
>
> On 2023.10.29 08:12 Peng Liu wrote:
>
> > Ping
> >
> > On 2023/10/7 13:46, Peng Liu wrote:
> >> From: Peng Liu <liupeng17@lenovo.com>
> >>
> >> To calculate Bzy_MHz, TSC_delta should multiply APERF_delta instead
> >> of dividing it.
> >>
> >> Signed-off-by: Peng Liu <liupeng17@lenovo.com>
> >> ---
> >>   tools/power/x86/turbostat/turbostat.8 | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8
> >> index 8f08c3fd498d..1ba6340d3b3d 100644
> >> --- a/tools/power/x86/turbostat/turbostat.8
> >> +++ b/tools/power/x86/turbostat/turbostat.8
> >> @@ -370,7 +370,7 @@ below the processor's base frequency.
> >>
> >>   Busy% = MPERF_delta/TSC_delta
> >>
> >> -Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
> >> +Bzy_MHz = TSC_delta*APERF_delta/MPERF_delta/measurement_interval
> >>
> >>   Note that these calculations depend on TSC_delta, so they
> >>   are not reliable during intervals when TSC_MHz is not running at the base frequency.
>
Peng Peng17 Liu Nov. 29, 2023, 1:57 a.m. UTC | #6
Len,

The new commit message is better. Thanks for your help
diff mbox series

Patch

diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8
index 8f08c3fd498d..1ba6340d3b3d 100644
--- a/tools/power/x86/turbostat/turbostat.8
+++ b/tools/power/x86/turbostat/turbostat.8
@@ -370,7 +370,7 @@  below the processor's base frequency.
 
 Busy% = MPERF_delta/TSC_delta
 
-Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
+Bzy_MHz = TSC_delta*APERF_delta/MPERF_delta/measurement_interval
 
 Note that these calculations depend on TSC_delta, so they
 are not reliable during intervals when TSC_MHz is not running at the base frequency.