xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Keir Fraser <keir@xen.org>,
	"andres@lagarcavilla.org" <andres@lagarcavilla.org>
Subject: Re: lock in vhpet
Date: Mon, 23 Apr 2012 10:14:45 +0100	[thread overview]
Message-ID: <20120423091445.GA17920@ocelot.phlegethon.org> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E0F1154@SHSMSX101.ccr.corp.intel.com>

At 07:36 +0000 on 23 Apr (1335166577), Zhang, Yang Z wrote:
> The p2m lock in __get_gfn_type_access() is the culprit. Here is the profiling data with 10 seconds:
> 
> (XEN) p2m_lock 1 lock:
> (XEN)   lock:      190733(00000000:14CE5726), block:       67159(00000007:6AAA53F3)
> 
> Those data is collected when win8 guest(16 vcpus) is idle. 16 VCPUs
> blocked 30 seconds with 10 sec's profiling. It means 18% of cpu cycle
> is waiting for the p2m lock. And those data only for idle guest. The
> impaction is more seriously when run some workload inside guest.  I
> noticed that this change was adding by cs 24770. And before it, we
> don't require the p2m lock in _get_gfn_type_access. So is this lock
> really necessary?

Ugh; that certainly is a regression.  We used to be lock-free on p2m
lookups and losing that will be bad for perf in lots of ways.  IIRC the
original aim was to use fine-grained per-page locks for this -- there
should be no need to hold a per-domain lock during a normal read.
Andres, what happened to that code?

Making it an rwlock would be tricky as this interface doesn't
differenctiate readers from writers.  For the common case (no
sharing/paging/mem-access) it ought to be a win since there is hardly
any writing.  But it would be better to make this particular lock/unlock
go away.

Tim.

  parent reply	other threads:[~2012-04-23  9:14 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17  3:26 lock in vhpet Zhang, Yang Z
2012-04-17  7:27 ` Keir Fraser
2012-04-18  0:52   ` Zhang, Yang Z
2012-04-18  7:13     ` Keir Fraser
2012-04-18  7:55       ` Zhang, Yang Z
2012-04-18  8:29         ` Keir Fraser
2012-04-18  9:14           ` Keir Fraser
2012-04-18  9:30             ` Keir Fraser
2012-04-19  5:19               ` Zhang, Yang Z
2012-04-19  8:27                 ` Tim Deegan
2012-04-19  8:47                   ` Keir Fraser
2012-04-23  7:36                     ` Zhang, Yang Z
2012-04-23  7:43                       ` Jan Beulich
2012-04-23  8:15                         ` Zhang, Yang Z
2012-04-23  8:22                           ` Keir Fraser
2012-04-23  9:14                       ` Tim Deegan [this message]
2012-04-23 15:26                         ` Andres Lagar-Cavilla
2012-04-24  9:15                           ` Tim Deegan
2012-04-24 13:28                             ` Andres Lagar-Cavilla
2012-04-23 17:18                         ` Andres Lagar-Cavilla
2012-04-24  8:58                           ` Zhang, Yang Z
2012-04-24  9:16                             ` Tim Deegan
2012-04-25  0:27                               ` Zhang, Yang Z
2012-04-25  1:40                                 ` Andres Lagar-Cavilla
2012-04-25  1:48                                   ` Zhang, Yang Z
2012-04-25  2:31                                     ` Andres Lagar-Cavilla
2012-04-25  2:36                                       ` Zhang, Yang Z
2012-04-25  2:42                                         ` Andres Lagar-Cavilla
2012-04-25  3:12                                           ` Zhang, Yang Z
2012-04-25  3:34                                             ` Andres Lagar-Cavilla
2012-04-25  5:18                                               ` Zhang, Yang Z
2012-04-25  8:07                                               ` Jan Beulich
2012-04-26 21:25                                         ` Tim Deegan
2012-04-27  0:46                                           ` Zhang, Yang Z
2012-04-27  0:51                                             ` Andres Lagar-Cavilla
2012-04-27  1:24                                               ` Zhang, Yang Z
2012-04-27  8:36                                               ` Zhang, Yang Z
2012-04-27  3:02                                           ` Andres Lagar-Cavilla
2012-04-27  9:26                                             ` Tim Deegan
2012-04-27 14:17                                               ` Andres Lagar-Cavilla
2012-04-27 21:08                                               ` Andres Lagar-Cavilla
2012-05-16 11:36                                           ` Zhang, Yang Z
2012-05-16 12:36                                             ` Tim Deegan
2012-05-17 10:57                                               ` Tim Deegan
2012-05-28  6:54                                                 ` Zhang, Yang Z

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=20120423091445.GA17920@ocelot.phlegethon.org \
    --to=tim@xen.org \
    --cc=andres@lagarcavilla.org \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xensource.com \
    --cc=yang.z.zhang@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).