All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.fraser@eu.citrix.com>
To: Rafal Wojtczuk <rafal@invisiblethingslab.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: Improving domU restore time
Date: Tue, 25 May 2010 14:02:40 +0100	[thread overview]
Message-ID: <C8218900.151AD%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <20100525125000.GB24082@emperor2.itldev.org>

On 25/05/2010 13:50, "Rafal Wojtczuk" <rafal@invisiblethingslab.com> wrote:

>> There is no guarantee that the memory will be zeroed.
> Interesting.
> For my education, could you explain who is responsible for clearing memory
> of a newborn domain ? Xend ? Could you point me to the relevant code
> fragments ?

New domains are not guaranteed to receive zeroed memory. The only guarantee
Xen provides is that when it frees memory for a *dead* domain, it will scrub
the contents before reallocation (it may not write zeroes however, in a
debug build of Xen for example!). Other memory pages the domain freeing the
pages must scrub them itself before freeing them back to Xen.

> It looks sensible to clear free memory in hypervisor context in its idle
> cycles; if non-temporal instructions (movnti) were used for this, it would
> not pollute caches, and it must be done anyway ?

Only for that one case (freeing pages of a dead domain). In that one case we
currently do it synchronously. But that is because it was better than my
previous crappy asynchronous scrubbing code. :-)

>>> b) xen-3.4.3/xc_restore reads data from savefile in 4k portions - so, one
>>> read syscall per page. Make it read in larger chunks. It looks it is fixed
>>> in
>>> xen-4.0.0, is this correct ?
>> 
>> It got changed a lot for Remus. I expect performance was on their mind.
>> Normally kernel's file readahead heuristic would get back most of the
>> performance of not reading in larger chunks.
> Yes, readahead would keep the disk request queue full, but I was just
> thinking of lowering the syscall overhead. 1e5 syscalls is a lot :)

Well the code looks like it batches now anyway. If it isn't, it would be
interesting to see if making batches would measurably improve performance.

 -- Keir

> [user@qubes ~]$ dd if=/dev/zero of=/dev/null bs=4k count=102400
> 102400+0 records in
> 102400+0 records out
> 419430400 bytes (419 MB) copied, 0.307211 s, 1.4 GB/s
> [user@qubes ~]$ dd if=/dev/zero of=/dev/null bs=4M count=100
> 100+0 records in
> 100+0 records out
> 419430400 bytes (419 MB) copied, 0.25347 s, 1.7 GB/s

  parent reply	other threads:[~2010-05-25 13:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25 10:35 Improving domU restore time Rafal Wojtczuk
2010-05-25 10:58 ` Joanna Rutkowska
2010-05-25 11:50 ` Keir Fraser
2010-05-25 12:50   ` Rafal Wojtczuk
2010-05-25 12:59     ` Keir Fraser
2010-05-25 13:33       ` scrubbing free'd pages James Harper
2010-05-25 13:39         ` Keir Fraser
2010-05-25 13:48           ` Paul Durrant
2010-05-25 14:12       ` scrubbing pages on vm pause Joanna Rutkowska
2010-05-25 14:13         ` Keir Fraser
2010-05-25 14:19           ` Joanna Rutkowska
2010-05-25 14:19             ` Keir Fraser
2010-05-25 14:24               ` Joanna Rutkowska
2010-05-25 13:02     ` Keir Fraser [this message]
2010-05-31  9:42   ` Improving domU restore time Rafal Wojtczuk
2010-06-01 17:00     ` Jeremy Fitzhardinge
2010-06-02 16:24       ` Rafal Wojtczuk
2010-06-02 16:33         ` Jeremy Fitzhardinge

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=C8218900.151AD%keir.fraser@eu.citrix.com \
    --to=keir.fraser@eu.citrix.com \
    --cc=rafal@invisiblethingslab.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 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.