All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ross Lagerwall <rosslagerwall@citrix.com>
To: Jan Beulich <jbeulich@suse.com>,
	ross.lagerwall@citrix.com, xen-devel@lists.xenproject.org
Cc: jinsong.liu@alibaba-inc.com, keir@xen.org
Subject: Re: [PATCH] cpuidle: Improve perf for certain workloads
Date: Fri, 13 Jun 2014 13:53:48 +0100	[thread overview]
Message-ID: <539AF45C.5050406@citrix.com> (raw)
In-Reply-To: <539AF07D02000078000B6509@mail.emea.novell.com>

On 06/13/2014 12:37 PM, Jan Beulich wrote:
>>>> Ross Lagerwall <ross.lagerwall@citrix.com> 06/13/14 12:23 PM >>>
>> The existing mechanism of using interrupt frequency as a heuristic does
>> not work well for certain workloads.  As an example, synchronous dd on a
>> small block size uses deep C-states because much of the time is spent
>> doing processing so the interrupt frequency is not too high, but when an
>> IOP is submitted, the interrupt occurs soon after going idle.  This
>> causes exit latency to be a significant factor.
>>
>> To fix this, add a new factor which limits the exit latency to be no
>> more than 10% of the decaying measured idle time.  This improves
>> performance for workloads with a medium interrupt frequency but a short
>> idle duration.
>
> Does this have a Linux counterpart (after all the code here is a clone from
> Linux'es)? If so, adding a cross reference would be appreciated. If not, I'd
> expect you to explain why Xen needs what Linux doesn't need.

No it does not have a Linux counterpart. The Linux equivalent code for 
exit latency uses a combination of the PM QOS interface, the load 
average of the system and the number of processes in IO wait state on 
that CPU. If a process is in IO wait state, it compares the exit latency 
with the predicted residency reduced by a factor of 10, which is 
somewhat similar to what this patch does.

The use of average interrupt frequency was introduced by Keir Fraser in 
353533232730 ("cpuidle: fix the menu governor to enhance IO 
performance") when porting a Linux patch to Xen.

>
>> In the workload given previously, throughput improves by 20% with this
>> patch.
>
> This is the positive side. Did you also check for no negative effects?

 From a performance perspective, this patch will never cause the machine 
to go in a deeper C-state than it would have previously.

 From a power perspective, I don't have a power meter to do actual 
measurements but watching xenpm on an idle system shows that almost all 
of the time is spent in the deepest C-state.

>
>> A side effect of this patch is to fix the use of MAX_INTERESTING.
>
> What does this sentence refer to?

I will make that more explicit in the commit message.

>
>> @@ -88,6 +89,10 @@
>    >* the average interrupt interval is, the smaller C state latency should be
>    >* and thus the less likely a busy CPU will hit such a deep C state.
>    >*
>> + * As an additional rule to reduce the performance impact, menu tries to
>> + * limit the exit latency duration to be no more than 10% of the decaying
>> + * measured idle time.
>> + *
>    >*/
>
> Even if previously there was a blank comment line at the end, please avoid
> retaining such when you add further text anyway.
>

OK.

Thanks for the review,
-- 
Ross Lagerwall

      reply	other threads:[~2014-06-13 12:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13 10:23 [PATCH] cpuidle: Improve perf for certain workloads Ross Lagerwall
2014-06-13 11:37 ` Jan Beulich
2014-06-13 12:53   ` Ross Lagerwall [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=539AF45C.5050406@citrix.com \
    --to=rosslagerwall@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jinsong.liu@alibaba-inc.com \
    --cc=keir@xen.org \
    --cc=ross.lagerwall@citrix.com \
    --cc=xen-devel@lists.xenproject.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.