xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: David Woodhouse <dwmw2@infradead.org>,
	Xen-devel <xen-devel@lists.xenproject.org>,
	"Xia, Hongyan" <hongyax@amazon.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Wei Liu" <wl@xen.org>,
	paul@xen.org, "George Dunlap" <George.Dunlap@eu.citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [RFC PATCH 0/3] Live update boot memory management
Date: Tue, 14 Jan 2020 14:15:31 +0000	[thread overview]
Message-ID: <1743ee7c-e238-8b77-d40f-bd0e3d6bb0ed@xen.org> (raw)
In-Reply-To: <4e3b0050ff7a8d1e40015181026562211e75c401.camel@infradead.org>

Hi David,

On 13/01/2020 11:54, David Woodhouse wrote:
> On Wed, 2020-01-08 at 17:24 +0000, David Woodhouse wrote:
>> When doing a live update, Xen needs to be very careful not to scribble
>> on pages which contain guest memory or state information for the
>> domains which are being preserved.
>>
>> The information about which pages are in use is contained in the live
>> update state passed from the previous Xen — which is mostly just a
>> guest-transparent live migration data stream, except that it points to
>> the page tables in place in memory while traditional live migration
>> obviously copies the pages separately.
>>
>> Our initial implementation actually prepended a list of 'in-use' ranges
>> to the live update state, and made the boot allocator treat them the
>> same as 'bad pages'. That worked well enough for initial development
>> but wouldn't scale to a live production system, mainly because the boot
>> allocator has a limit of 512 memory ranges that it can keep track of,
>> and a real system would end up more fragmented than that.
>>
>> My other concern with that approach is that it required two passes over
>> the domain-owned pages. We have to do a later pass *anyway*, as we set
>> up ownership in the frametable for each page — and that has to happen
>> after we've managed to allocate a 'struct domain' for each page_info to
>> point to. If we want to keep the pause time due to a live update down
>> to a bare minimum, doing two passes over the full set of domain pages
>> isn't my favourite strategy.

We actually need one more pass for PV domain (at least). The pass is 
used to allocate the page type (e.g L4, L1,...). This can't be done 
before because we need the pages to belongs to the guest before going 
through its page-tables.

>>
>> So we've settled on a simpler approach \x02— reserve a contiguous region
>> of physical memory which *won't* be used for domain pages. Let the boot
>> allocator see *only* that region of memory, and plug the rest of the
>> memory in later only after doing a full pass of the live update state.

It is a bit unclear what the region will be used for. If you plan to put 
the state of the VMs in it, then you can't possibly use it for boot 
allocation (e.g frametable) otherwise this may be overwritten when doing 
the live update.
The problem would arise in the first Xen but also in the second Xen if 
you plan to live update another time.

Did I miss anything?

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2020-01-14 14:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 17:24 [Xen-devel] [RFC PATCH 0/3] Live update boot memory management David Woodhouse
2020-01-08 17:24 ` [Xen-devel] [RFC PATCH 1/3] x86/setup: Don't skip 2MiB underneath relocated Xen image David Woodhouse
2020-01-08 17:24   ` [Xen-devel] [RFC PATCH 2/3] x86/boot: Reserve live update boot memory David Woodhouse
2020-01-20 16:58     ` Jan Beulich
2020-01-20 17:24       ` David Woodhouse
2020-01-08 17:25   ` [Xen-devel] [RFC PATCH 3/3] Add KEXEC_RANGE_MA_LIVEUPDATE David Woodhouse
2020-01-10 11:15   ` [Xen-devel] [RFC PATCH 1/3] x86/setup: Don't skip 2MiB underneath relocated Xen image Durrant, Paul
2020-01-10 12:15     ` David Woodhouse
2020-01-13 11:54 ` [Xen-devel] [RFC PATCH 0/3] Live update boot memory management David Woodhouse
2020-01-14 14:15   ` Julien Grall [this message]
2020-01-14 14:48     ` David Woodhouse
2020-01-14 15:00       ` Julien Grall
2020-01-14 15:20         ` David Woodhouse
2020-01-14 16:29           ` Julien Grall
2020-01-15  7:40             ` David Woodhouse
2020-01-15 10:26               ` Julien Grall

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=1743ee7c-e238-8b77-d40f-bd0e3d6bb0ed@xen.org \
    --to=julien@xen.org \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dwmw2@infradead.org \
    --cc=hongyax@amazon.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=paul@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --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 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).