xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.fraser@eu.citrix.com>
To: "Wei, Gang" <gang.wei@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] CPUIDLE: shorten hpet spin_lock holding time
Date: Wed, 21 Apr 2010 09:09:59 +0100	[thread overview]
Message-ID: <C7F47167.11F3E%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <F26D193E20BBDC42A43B611D1BDEDE710270AE3EE1@shsmsx502.ccr.corp.intel.com>

On 20/04/2010 17:05, "Wei, Gang" <gang.wei@intel.com> wrote:

> Resend.
> 
> CPUIDLE: shorten hpet spin_lock holding time
> 
> Try to reduce spin_lock overhead for deep C state entry/exit. This will
> benefit systems with a lot of cpus which need the hpet broadcast to wakeup
> from deep C state.
> 
> Signed-off-by: Wei Gang <gang.wei@intel.com>

It fixes the unsafe accesses to timer_deadline_{start,end} but I still think
this optimisation is misguided and also unsafe. There is nothing to stop new
CPUs being added to ch->cpumask after you start scanning ch->cpumask. For
example, some new CPU which has a timer_deadline_end greater than
ch->next_event, so it does not reprogram the HPET. But handle_hpet_broadcast
is already mid-scan and misses this new CPU, so it does not reprogram the
HPET either. Hence no timer fires for the new CPU and it misses its
deadline.

Really I think a better approach than something like this patch would be to
better advertise the timer_slop=xxx Xen boot parameter for power-saving
scenarios. I wonder what your numbers look like if you re-run your benchmark
with (say) timer_slop=10000000 (i.e., 10ms slop) on the Xen command line?

 -- Keir

  reply	other threads:[~2010-04-21  8:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20  5:39 [PATCH] CPUIDLE: shorten hpet spin_lock holding time Wei, Gang
2010-04-20 12:49 ` Keir Fraser
2010-04-20 14:04   ` Wei, Gang
2010-04-20 14:21     ` Keir Fraser
2010-04-20 15:20       ` Wei, Gang
2010-04-20 16:05       ` Wei, Gang
2010-04-21  8:09         ` Keir Fraser [this message]
2010-04-21  9:06           ` Wei, Gang
2010-04-21  9:25             ` Keir Fraser
2010-04-21  9:36               ` Wei, Gang
2010-04-21  9:52                 ` Keir Fraser
2010-04-21 10:03                   ` Keir Fraser
2010-04-22  3:59                     ` Wei, Gang
2010-04-22  7:22                       ` Keir Fraser
2010-04-22  8:19                         ` Keir Fraser
2010-04-22  8:23                           ` Keir Fraser
2010-04-29 11:08                             ` Wei, Gang
2010-04-22  8:21         ` Keir Fraser
2010-04-29 11:14           ` Wei, Gang

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=C7F47167.11F3E%keir.fraser@eu.citrix.com \
    --to=keir.fraser@eu.citrix.com \
    --cc=gang.wei@intel.com \
    --cc=xen-devel@lists.xensource.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).