From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jeff Garzik <jgarzik@pobox.com>,
Jens Axboe <jens.axboe@oracle.com>,
LKML <linux-kernel@vger.kernel.org>,
Ian Campbell <Ian.Campbell@eu.citrix.com>
Subject: Re: [PATCH 5 of 5] xen: Avoid allocations causing swap activity on the resume path
Date: Sun, 01 Jun 2008 01:38:35 +0100 [thread overview]
Message-ID: <4841EF8B.3060800@goop.org> (raw)
In-Reply-To: <20080531164712.2788baf2.akpm@linux-foundation.org>
Andrew Morton wrote:
> On Sat, 31 May 2008 11:10:18 +0100 Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
>
>>> Whether you should also add __GFP_HIGH to cause the page allocation to
>>> bite harder into the page reserves is unclear to me, sorry.
>>>
>>>
>> Well, if the allocation fails the machine is dead in the water, because
>> it probably can't go on without its devices. I think it's worth eating
>> to the reserves to avoid that. (I'll have a close look to only add it
>> to allocations which are really unrecoverable if they fail.)
>>
>
> OK.
>
> I don't actually have a clue what you're doing here. Restoring a
> virtual machine from disk/network or something like that?
>
More or less. When you suspend the VM it gets disconnected from all its
virtual devices. When you resume - which may be after a migration to
another machine - it reconnects to all its devices again. These
allocations are happening on the reconnection path, and so may happen
before there's any underlying device to do IO to (in fact, they've been
triggered by something trying to do IO, and the driver notices it has
become disconnected and tries to reconnect itself).
> It might be appropriate to do a big memory-reclaim before starting the
> operation, along the lines of suspend-to-disk - go off and allocate
> (and possible pin) sufficient memroy for the entire operation before
> actually starting it?
>
Not really. Live migration - which is one instance of when this comes
into play - is a very lightweight process from the guest VM's
perspective, and may cause only ~100ms service interruption. Doing a
mass of reclaim/IO would be expensive by comparison.
Also, in general the drivers have to be prepared to deal with a
disconnection from their devices at any moment (ie, they may
spontaneously disconnect for no apparent reason), so there's no
opportunity to prepare for it.
Maybe it would be possible to scurry away some preallocated memory for
use if the main allocation fails, but that seems logically equivalent to
dipping into the global emergency pool.
J
next prev parent reply other threads:[~2008-06-01 0:39 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-31 0:01 [PATCH 0 of 5] xen device driver updates [resend] Jeremy Fitzhardinge
2008-05-31 0:01 ` [PATCH 1 of 5] xen/blkfront: Make sure we don't use bounce buffers, we don't need them Jeremy Fitzhardinge
2008-05-31 1:55 ` Jeff Garzik
2008-05-31 0:01 ` [PATCH 2 of 5] xn/blkfront: Add the CDROM_GET_CAPABILITY ioctl to blkfront Jeremy Fitzhardinge
2008-05-31 1:57 ` Jeff Garzik
2008-05-31 7:08 ` Jeremy Fitzhardinge
2008-05-31 0:01 ` [PATCH 3 of 5] xen/blkfront: Make sure that the device is fully ready before allowing release Jeremy Fitzhardinge
2008-05-31 0:01 ` [PATCH 4 of 5] xen/blkfront: add __exit to module_exit() handlers Jeremy Fitzhardinge
2008-05-31 1:57 ` Jeff Garzik
2008-05-31 0:01 ` [PATCH 5 of 5] xen: Avoid allocations causing swap activity on the resume path Jeremy Fitzhardinge
2008-05-31 1:58 ` Jeff Garzik
2008-05-31 9:50 ` Jeremy Fitzhardinge
2008-05-31 9:59 ` Andrew Morton
2008-05-31 10:10 ` Jeremy Fitzhardinge
2008-05-31 23:47 ` Andrew Morton
2008-06-01 0:38 ` Jeremy Fitzhardinge [this message]
2008-05-31 1:54 ` [PATCH 0 of 5] xen device driver updates [resend] Jeff Garzik
2008-05-31 6:31 ` Jeremy Fitzhardinge
-- strict thread matches above, loose matches on Subject: below --
2008-05-30 23:50 [PATCH 0 of 5] xen device driver updates Jeremy Fitzhardinge
2008-05-30 23:50 ` [PATCH 5 of 5] xen: Avoid allocations causing swap activity on the resume path 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=4841EF8B.3060800@goop.org \
--to=jeremy@goop.org \
--cc=Ian.Campbell@eu.citrix.com \
--cc=akpm@linux-foundation.org \
--cc=jens.axboe@oracle.com \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.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