From: Yuyang Du <yuyang.du@intel.com>
To: dirk.brandewie@gmail.com
Cc: linux-pm@vger.kernel.org, rjw@rjwysocki.net, dsmythies@telus.net,
Dirk Brandewie <dirk.j.brandewie@intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH 3/4] intel_pstate: add sample time scaling
Date: Fri, 30 May 2014 02:17:04 +0800 [thread overview]
Message-ID: <20140529181704.GA4691@intel.com> (raw)
In-Reply-To: <1401381145-17745-4-git-send-email-dirk.j.brandewie@intel.com>
> static inline int32_t intel_pstate_get_scaled_busy(struct cpudata *cpu)
> {
> - int32_t core_busy, max_pstate, current_pstate;
> + int32_t core_busy, max_pstate, current_pstate, sample_ratio;
> + u32 duration_us;
> + u32 sample_time;
>
> core_busy = cpu->sample.core_pct_busy;
> max_pstate = int_tofp(cpu->pstate.max_pstate);
> current_pstate = int_tofp(cpu->pstate.current_pstate);
> core_busy = mul_fp(core_busy, div_fp(max_pstate, current_pstate));
> +
> + sample_time = (pid_params.sample_rate_ms * USEC_PER_MSEC);
> + duration_us = (u32) ktime_us_delta(cpu->sample.time,
> + cpu->last_sample_time);
> + if (duration_us > sample_time * 3) {
> + sample_ratio = div_fp(int_tofp(sample_time),
> + int_tofp(duration_us));
> + core_busy = mul_fp(core_busy, sample_ratio);
> + }
> +
> return core_busy;
> }
Hi Dirk,
I am afraid I need to question again since you did not address my concern.
So generally, this new patch will factor (sample_rate / duration) in
(last_freq / last_request) if duration > 3*sample_time.
This sample_rate / duration thing looks random. And otherwise it is still
effectively performance governor behavior if what I reasoned before is right.
So my opinion is, the C0 tracking is not the (true) root cause to perf regression.
But if you really need this patch as a temp workaround, it is ok.
Thanks,
Yuyang
next prev parent reply other threads:[~2014-05-29 18:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 16:32 [PATCH 0/4] intel_pstate fixes for v3.16 dirk.brandewie
2014-05-29 16:32 ` [PATCH 1/4] intel_pstate: Remove C0 tracking dirk.brandewie
2014-05-29 16:32 ` [PATCH 2/4] intel_pstate: Correct rounding in busy calculation dirk.brandewie
2014-06-15 14:44 ` Doug Smythies
2014-06-15 22:46 ` Rafael J. Wysocki
2014-05-29 16:32 ` [PATCH 3/4] intel_pstate: add sample time scaling dirk.brandewie
2014-05-29 18:17 ` Yuyang Du [this message]
2014-06-09 15:58 ` Doug Smythies
2014-05-29 16:32 ` [PATCH 4/4] intel_pstate: Improve initial busy calculation dirk.brandewie
[not found] ` <CADmjqpNoRjhO=BaRBXxONCWd8-i9tzDLGVF4fTBs4jfRtHbdxw@mail.gmail.com>
2014-05-30 0:04 ` [PATCH 0/4] intel_pstate fixes for v3.16 Stratos Karafotis
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=20140529181704.GA4691@intel.com \
--to=yuyang.du@intel.com \
--cc=dirk.brandewie@gmail.com \
--cc=dirk.j.brandewie@intel.com \
--cc=dsmythies@telus.net \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=stable@vger.kernel.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.