linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: "Doug Smythies" <dsmythies@telus.net>,
	"'Rafael Wysocki'" <rafael.j.wysocki@intel.com>,
	"'Jörg Otte'" <jrg.otte@gmail.com>,
	"'Linux Kernel Mailing List'" <linux-kernel@vger.kernel.org>,
	"'Linux PM'" <linux-pm@vger.kernel.org>,
	"'Srinivas Pandruvada'" <srinivas.pandruvada@linux.intel.com>
Subject: Re: Performance of low-cpu utilisation benchmark regressed severely since 4.6
Date: Fri, 21 Apr 2017 03:12:21 +0200	[thread overview]
Message-ID: <4801571.0BMNcJV3bj@aspire.rjw.lan> (raw)
In-Reply-To: <20170419081537.byeqli7qrnqqvyue@techsingularity.net>

On Wednesday, April 19, 2017 09:15:37 AM Mel Gorman wrote:
> On Fri, Apr 14, 2017 at 04:01:40PM -0700, Doug Smythies wrote:
> > Hi Mel,
> > 
> > Thanks for the "how to" information.
> > This is a very interesting use case.
> > From trace data, I see a lot of minimal durations with
> > virtually no load on the CPU, typically more consistent
> > with some type of light duty periodic (~~100 Hz) work flow
> > (where we would prefer to not ramp up frequencies, or more
> > accurately keep them ramped up).
> 
> This broadly matches my expectations in terms of behaviour. It is a
> low duty workload but while I accept that a laptop may not want the
> frequencies to ramp up, it's not universally true. Long periods at low
> frequency to complete a workload is not necessarily better than using a
> high frequency to race to idle. Effectively, a low utilisation test suite
> could be considered as a "foreground task of high priority" and not a
> "background task of little interest".

That's fair enough, but somewhat hard to tell from within a scaling governor. :-)

[cut]

> 
> I have no reason to believe this is a methodology error and is due to a
> difference in CPU. Consider the following reports
> 
> http://beta.suse.com/private/mgorman/results/home/marvin/openSUSE-LEAP-42.2/global-dhp__workload_shellscripts-xfs/delboy/#gitsource
> http://beta.suse.com/private/mgorman/results/home/marvin/openSUSE-LEAP-42.2/global-dhp__workload_shellscripts-xfs/ivy/#gitsource
> 
> The first one (delboy) shows a gain of 1.35% and it's only for 4.11
> (kernel shown is 4.11-rc1 with vmscan-related patches on top that do not
> affect this test case) of -17.51% which is very similar to yours. The
> CPU there is a Xeon E3-1230 v5.
> 
> The second report (ivy) is the machine I'm based the original complain
> on and shows the large regression in elapsed time.
> 
> So, different CPUs have different behaviours which is no surprise at all
> considering that at the very least, exit latencies will be different.
> While there may not be a universally correct answer to how to do this
> automatically, is it possible to tune intel_pstate such that it ramps up
> quickly regardless of recent utilisation and reduces relatively slowly?
> That would be better from a power consumption perspective than setting the
> "performance" governor.

It should be, theoretically.

The way the load-based P-state selection algorithm works is based on computing
average utilization periodically and setting the frequency proportional to it with
a couple of twists.  The first twist is that the frequency will be bumped up for
tasks that have waited on I/O ("IO-wait boost").  The second one is that if the
frequency is to be reduced, it will not go down proportionally to the computed
average utilization, but to the frequency between the current (measured) one
and the one proportional to the utilization (so it will go down asymptotically
rather than in one go).

Now, of course, what matters is how often the average utilization is computed,
because if we average several small spikes over a broad sampling window, they
will just almost vanish in the average and the resulting frequency will be small.
If, in turn, the sampling interval is reduced, some intervals will get the spikes
(and for them the average utilization will be greater) and some of them will
get nothing (leading to average utilization close to zero) and now all depends
on the distribution of the spikes along the time axis.

You can actually try to test that on top of my linux-next branch by reducing
INTEL_PSTATE_DEFAULT_SAMPLING_INTERVAL (in intel_pstate.c) by, say, 1/2.

Thanks,
Rafael

  reply	other threads:[~2017-04-21  1:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10  8:41 Performance of low-cpu utilisation benchmark regressed severely since 4.6 Mel Gorman
2017-04-10 20:51 ` Rafael J. Wysocki
2017-04-11 10:02   ` Mel Gorman
2017-04-21  0:52     ` Rafael J. Wysocki
2017-04-11 15:41   ` Doug Smythies
2017-04-11 16:42     ` Mel Gorman
2017-04-14 23:01     ` Doug Smythies
2017-04-19  8:15       ` Mel Gorman
2017-04-21  1:12         ` Rafael J. Wysocki [this message]
2017-04-20 14:55       ` Doug Smythies
2017-04-21  1:17         ` Rafael J. Wysocki
2017-04-22  6:29         ` Doug Smythies
2017-04-22 21:07           ` Rafael J. Wysocki
2017-04-24 10:01             ` Mel Gorman
2017-04-23 15:31           ` Doug Smythies
2017-04-24  0:59             ` Rafael J. Wysocki
2017-04-24  1:21               ` Srinivas Pandruvada
2017-04-24 14:24               ` Doug Smythies
2017-04-25  7:13               ` Doug Smythies
2017-04-25 21:26                 ` Rafael J. Wysocki
2017-04-25 21:03               ` Doug Smythies

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=4801571.0BMNcJV3bj@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=dsmythies@telus.net \
    --cc=jrg.otte@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=rafael.j.wysocki@intel.com \
    --cc=srinivas.pandruvada@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).