From: Stratos Karafotis <stratosk@semaphore.gr>
To: Doug Smythies <dsmythies@telus.net>,
'Dirk Brandewie' <dirk.brandewie@gmail.com>,
"'Rafael J. Wysocki'" <rjw@rjwysocki.net>,
'Viresh Kumar' <viresh.kumar@linaro.org>,
'Dirk Brandewie' <dirk.j.brandewie@intel.com>
Cc: linux-pm@vger.kernel.org, 'LKML' <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/7] cpufreq: intel_pstate: Avoid duplicate call of intel_pstate_get_scaled_busy
Date: Sat, 14 Jun 2014 21:10:05 +0300 [thread overview]
Message-ID: <539C8FFD.9030607@semaphore.gr> (raw)
In-Reply-To: <000b01cf87e7$b06afb30$1140f190$@net>
On 14/06/2014 06:45 μμ, Doug Smythies wrote:
> I am sorry to be late chiming in on this one.
>
> On 2014.06.10 09:27 Stratos Karafotis wrote:
>> On 10/06/2014 07:05 μμ, Dirk Brandewie wrote:
>> On 06/09/2014 02:00 PM, Stratos Karafotis wrote:
>>> Store busy_scaled value to avoid to duplicate call of
>>> intel_pstate_get_scaled_busy on every sampling interval.
>>>
>>>
>>> The second call *only* happens if the tracepoint is being used otherwise
>>> the whole function call to trace_pstate_sample() is a noop.
>
>> Yes, I'm sorry, I forgot to add this in my changelog. I have written this
>> in cover letter.
>> I made this change mostly to support patch 3/7.
>
>>> This makes the code less readable IMHO the reader is left wondering
>>> how cpu->sample.busy_scaled was set in intel_pstate_adjust_busy_pstate()
>>>
>
>> I agree that the the original code is more readable. If we don't care
>> about the small overhead when tracing is on and forget patch 3/7,
>> of course the original code is by far better.
>
> Actually, when reading the code, I found it odd to call the function
> twice.
>
> However by far the much more important issue here, in my opinion,
> is that if one is using the tracepoint stuff, then the second call
> to intel_pstate_get_scaled_busy can give a different result than
> the first call. Why? Because "cpu->pstate.current_pstate" may have
> changed between the two calls.
>
> In the end the user (me in this case) of the tracepoint stuff can
> end up pulling (what's left of) their hair out and going around in
> circles attempting to figure out why doing the so simple math by
> hand doesn't seem to agree with the tracepoint data.
:)
> As a side note: I am now pulling the tracepoint data into a
> spreadsheet and calculating what "scaled" should be myself.
>
I think you are right. Tracepoint data might be inconsistent.
I will re-submit this patch in v2 series, updating the changelog.
Thanks for pointing this out!
Stratos
prev parent reply other threads:[~2014-06-14 18:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-09 21:00 [PATCH 2/7] cpufreq: intel_pstate: Avoid duplicate call of intel_pstate_get_scaled_busy Stratos Karafotis
2014-06-10 16:05 ` Dirk Brandewie
2014-06-10 16:26 ` Stratos Karafotis
2014-06-14 15:45 ` Doug Smythies
2014-06-14 15:45 ` Doug Smythies
2014-06-14 18:10 ` Stratos Karafotis [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=539C8FFD.9030607@semaphore.gr \
--to=stratosk@semaphore.gr \
--cc=dirk.brandewie@gmail.com \
--cc=dirk.j.brandewie@intel.com \
--cc=dsmythies@telus.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=viresh.kumar@linaro.org \
/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.