* [Qemu-devel] balloon vs postcopy migrate
@ 2015-02-03 17:09 Dr. David Alan Gilbert
2015-02-03 17:36 ` Pankaj Gupta
2015-02-10 18:49 ` Dr. David Alan Gilbert
0 siblings, 2 replies; 4+ messages in thread
From: Dr. David Alan Gilbert @ 2015-02-03 17:09 UTC (permalink / raw)
To: qemu-devel; +Cc: Amit Shah, aarcange, gal, Luiz Capitulino
Hi,
Andrea pointed out there is a risk that a guest inflating its
balloon during a postcopy migrate could cause us problems, and
I wanted to see what the best way of avoiding the problem was.
Guests inflating there balloon cause an madvise(MADV_DONTNEED) on
the host, marking pages as not present, that will potentially trigger
a userfault, that we are using in postcopy to detect pages that need
to be fetched from the source.
In theory, at the moment guests *should* only ask for a balloon
inflation if they've been asked to do so by the host; however there
are no guards for that, and it's been suggested giving the
guest more freedom might be a good idea anyway.
My alternatives seem to be:
1) Stop servicing the message queue from the guest so
that we just don't notice the inflate messages until
afterwards. (Easy for Qemu, not sure how the guests
will like an unserviced queue).
2) I could keep servicing the queue and ignore the messages
(Easy for everyone, not very nice in actual used memory -
does it cause any long term problems other than that?)
3) I could keep servicing the queue but put the messages
in a list somewhere that replay after migrate has finished.
(That list sounds bounded only in a very large way?)
Thoughts?
Dave
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] balloon vs postcopy migrate
2015-02-03 17:09 [Qemu-devel] balloon vs postcopy migrate Dr. David Alan Gilbert
@ 2015-02-03 17:36 ` Pankaj Gupta
2015-02-03 17:38 ` Dr. David Alan Gilbert
2015-02-10 18:49 ` Dr. David Alan Gilbert
1 sibling, 1 reply; 4+ messages in thread
From: Pankaj Gupta @ 2015-02-03 17:36 UTC (permalink / raw)
To: Dr. David Alan Gilbert
Cc: Amit Shah, aarcange, Luiz Capitulino, qemu-devel, gal
> Hi,
> Andrea pointed out there is a risk that a guest inflating its
> balloon during a postcopy migrate could cause us problems, and
> I wanted to see what the best way of avoiding the problem was.
>
> Guests inflating there balloon cause an madvise(MADV_DONTNEED) on
> the host, marking pages as not present, that will potentially trigger
> a userfault, that we are using in postcopy to detect pages that need
> to be fetched from the source.
>
> In theory, at the moment guests *should* only ask for a balloon
> inflation if they've been asked to do so by the host; however there
> are no guards for that, and it's been suggested giving the
> guest more freedom might be a good idea anyway.
>
> My alternatives seem to be:
> 1) Stop servicing the message queue from the guest so
> that we just don't notice the inflate messages until
> afterwards. (Easy for Qemu, not sure how the guests
> will like an unserviced queue).
>
> 2) I could keep servicing the queue and ignore the messages
> (Easy for everyone, not very nice in actual used memory -
> does it cause any long term problems other than that?)
>
> 3) I could keep servicing the queue but put the messages
> in a list somewhere that replay after migrate has finished.
> (That list sounds bounded only in a very large way?)
>
> Thoughts?
Can we have some global flag somewhere when Post copy is ON/active.
And we can ignore or defer only inflate/ballon messages/commands while
servicing the commands with some warnings.
Just my thought on logic. Not sure if I am missing some background here.
>
> Dave
>
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] balloon vs postcopy migrate
2015-02-03 17:36 ` Pankaj Gupta
@ 2015-02-03 17:38 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 4+ messages in thread
From: Dr. David Alan Gilbert @ 2015-02-03 17:38 UTC (permalink / raw)
To: Pankaj Gupta; +Cc: Amit Shah, aarcange, Luiz Capitulino, qemu-devel, gal
* Pankaj Gupta (pagupta@redhat.com) wrote:
>
> > Hi,
> > Andrea pointed out there is a risk that a guest inflating its
> > balloon during a postcopy migrate could cause us problems, and
> > I wanted to see what the best way of avoiding the problem was.
> >
> > Guests inflating there balloon cause an madvise(MADV_DONTNEED) on
> > the host, marking pages as not present, that will potentially trigger
> > a userfault, that we are using in postcopy to detect pages that need
> > to be fetched from the source.
> >
> > In theory, at the moment guests *should* only ask for a balloon
> > inflation if they've been asked to do so by the host; however there
> > are no guards for that, and it's been suggested giving the
> > guest more freedom might be a good idea anyway.
> >
> > My alternatives seem to be:
> > 1) Stop servicing the message queue from the guest so
> > that we just don't notice the inflate messages until
> > afterwards. (Easy for Qemu, not sure how the guests
> > will like an unserviced queue).
> >
> > 2) I could keep servicing the queue and ignore the messages
> > (Easy for everyone, not very nice in actual used memory -
> > does it cause any long term problems other than that?)
> >
> > 3) I could keep servicing the queue but put the messages
> > in a list somewhere that replay after migrate has finished.
> > (That list sounds bounded only in a very large way?)
> >
> > Thoughts?
>
> Can we have some global flag somewhere when Post copy is ON/active.
> And we can ignore or defer only inflate/ballon messages/commands while
> servicing the commands with some warnings.
>
> Just my thought on logic. Not sure if I am missing some background here.
Oh yes, the global flag is the easy part; the only question is what
the best thing to do is when it's set.
Dave
>
> >
> > Dave
> >
> > --
> > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
> >
> >
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] balloon vs postcopy migrate
2015-02-03 17:09 [Qemu-devel] balloon vs postcopy migrate Dr. David Alan Gilbert
2015-02-03 17:36 ` Pankaj Gupta
@ 2015-02-10 18:49 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 4+ messages in thread
From: Dr. David Alan Gilbert @ 2015-02-10 18:49 UTC (permalink / raw)
To: qemu-devel; +Cc: Amit Shah, aarcange, gal, Luiz Capitulino
* Dr. David Alan Gilbert (dgilbert@redhat.com) wrote:
> Hi,
> Andrea pointed out there is a risk that a guest inflating its
> balloon during a postcopy migrate could cause us problems, and
> I wanted to see what the best way of avoiding the problem was.
>
> Guests inflating there balloon cause an madvise(MADV_DONTNEED) on
> the host, marking pages as not present, that will potentially trigger
> a userfault, that we are using in postcopy to detect pages that need
> to be fetched from the source.
>
> In theory, at the moment guests *should* only ask for a balloon
> inflation if they've been asked to do so by the host; however there
> are no guards for that, and it's been suggested giving the
> guest more freedom might be a good idea anyway.
>
> My alternatives seem to be:
> 1) Stop servicing the message queue from the guest so
> that we just don't notice the inflate messages until
> afterwards. (Easy for Qemu, not sure how the guests
> will like an unserviced queue).
>
> 2) I could keep servicing the queue and ignore the messages
> (Easy for everyone, not very nice in actual used memory -
> does it cause any long term problems other than that?)
>
> 3) I could keep servicing the queue but put the messages
> in a list somewhere that replay after migrate has finished.
> (That list sounds bounded only in a very large way?)
As a follow up question; why is 'balloon_page' part of virtio-balloon.c
rather than balloon.c ?
I'm thinking of implementing (3) by putting a queue in front
of balloon_page, but it seems to make more sense to put that
type of thing in shared code (migration shouldn't need to know
it's virtio that's the transport?)
Dave
>
> Thoughts?
>
> Dave
>
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-10 18:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-03 17:09 [Qemu-devel] balloon vs postcopy migrate Dr. David Alan Gilbert
2015-02-03 17:36 ` Pankaj Gupta
2015-02-03 17:38 ` Dr. David Alan Gilbert
2015-02-10 18:49 ` Dr. David Alan Gilbert
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).