xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "James Harper" <james.harper@bendigoit.com.au>
To: Tim Deegan <Tim.Deegan@citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: RE: slow xp hibernation revisited
Date: Sat, 4 Jun 2011 13:16:56 +1000	[thread overview]
Message-ID: <AEC6C66638C05B468B556EA548C1A77D01D5775A@trantor> (raw)
In-Reply-To: <20110603154337.GT5098@whitby.uk.xensource.com>

> At 01:34 +1000 on 04 Jun (1307151275), James Harper wrote:
> > I'm revisiting the problem where xp hangs on the first hibernation
after
> > a boot. When the hibernate hangs for a while, strace -T -p shows
around
> > 600/second of:
> >
> > mmap(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_SHARED, 6, 0) =
> > 0x7fb9cfa38000 <0.000036>
> > ioctl(6, IOCTL_PRIVCMD_MMAPBATCH_V2, 0x7fff2c8b0f20) = -1 EINVAL
> > (Invalid argument) <0.000027>
> > ioctl(6, IOCTL_PRIVCMD_MMAPBATCH, 0x7fff2c8b0f40) = 0 <0.002878>
> > munmap(0x7fb9cfa38000, 1048576) = 0 <0.000111>
> >
> > Nothing like that is seen during normal execution, and the pause
only
> > occurs on the first hibernate, never on subsequent hibernates (eg
after
> > resume then hibernate again) until the DomU is rebooted. Working
> > backwards, those ioctl's appear to be called in libxc from
> > xc_map_foreign_xxx, but I'm getting a bit lost from there. Any
> > suggestions on how to track down what is causing this? Originally I
> > thought it might have been PoD memory causing the performance hit
but
> > this DomU is fully populated aside from a few hundred kb.
> 
> I think this is a bug in the qemu-dm mapcache code, which I saw
recently
> while trying to boot Xen inside Xen.  Large memcpys that are handled
by
> qemu seem to end up wwith a map and unmap for every byte of a REP
MOVSB.
> 
> AIUI the logic in the mapcache is something like:
>  - Each bucket contains a number of 'locked' mappings (which aren't
used
>    for this kind of copy).
>  - At the bottom of each bucket is a possible 'unlocked' mapping.
>  - If the unlocked mapping matches the address you want, reuse it
>  - Else discard it and replace it with a new unlocked mapping to your
>    target area.
> 
> But something is going on and the "else" clause is happening every
> time.
> 
> Unfortunately that's as far as I got before I needed to work on
> something else. :(
> 

Can you take a guess at what DomU behaviour would trigger the above?

Thanks

James

  reply	other threads:[~2011-06-04  3:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-03 15:34 slow xp hibernation revisited James Harper
2011-06-03 15:43 ` Tim Deegan
2011-06-04  3:16   ` James Harper [this message]
2011-06-04  4:46   ` James Harper
2011-06-04  4:54     ` James Harper
2011-06-04  6:39       ` Keir Fraser
2011-06-04  7:38         ` James Harper
2011-06-04  7:51           ` Keir Fraser
2011-06-04  8:05             ` James Harper
2011-06-04  8:30               ` Keir Fraser
2011-06-06 13:58                 ` Stefano Stabellini
2011-06-21 17:05                   ` Ian Jackson
2011-06-21 18:00                     ` Stefano Stabellini
2011-06-04  8:33               ` Keir Fraser
2011-06-06 13:09               ` Stefano Stabellini
2011-06-06 13:26                 ` James Harper
2011-06-06 13:29                   ` James Harper
2011-06-06 13:38                     ` Stefano Stabellini
2011-06-06 13:35                   ` Stefano Stabellini

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=AEC6C66638C05B468B556EA548C1A77D01D5775A@trantor \
    --to=james.harper@bendigoit.com.au \
    --cc=Tim.Deegan@citrix.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).