All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xenproject.org, daniel.kiper@oracle.com
Subject: Re: kexec -e in PVHVM guests (and in PV).
Date: Mon, 30 Jun 2014 18:28:07 +0200	[thread overview]
Message-ID: <20140630162807.GA3529@aepfle.de> (raw)
In-Reply-To: <20140630153600.GA19885@laptop.dumpdata.com>

On Mon, Jun 30, Konrad Rzeszutek Wilk wrote:

>  4). Balloon memory. I am not really sure how to deal with that. The
>      guest might have ballooned out tons of memory but the new kernel
>      won't know about it until the xen/balloon driver kicks in and
>      figures this out based on XenStore. Then it will try to balloon
>      out.. and depending on its luck - balloon out memory that was
>      already ballooned out, or not.  Also during the bootup of
>      the 'kexec -e' kernel it might touch pages that had been
>      ballooned out - and try to use them!

The solution so far is to balloon up until all ballooned pages are
backed by RAM.

Long time ago I had the idea to give the new kernel large ranges of
contigous memory. To do that I had some buggy code in the kexec code
path which claims all free pfns. Then it walks through the list of
ballooned pfns and flips the state of the pfn, a ballooned pfn gets
unballooned and a free page becomes ballooned. The result is that there
are eventually large contigous ranges for the startup code of the new
kernel. Later the mm init code of the new kernel walks the whole pfn
range and creates a list of already ballooned pfns for the balloon
driver and the mm itself.

This catch was, and likely still is: what does the kexec startup code
expect as memory layout? What ranges of memory does it need to touch? At
the time of kexec -l the memory layout differs from the memory layout at
kexec -e. Once this is solved something like the page flipping above can
be implemented.

Olaf

  parent reply	other threads:[~2014-06-30 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 15:36 kexec -e in PVHVM guests (and in PV) Konrad Rzeszutek Wilk
2014-06-30 16:05 ` David Vrabel
2014-06-30 16:21   ` Konrad Rzeszutek Wilk
2014-06-30 16:28 ` Olaf Hering [this message]
2014-07-01  8:12 ` Vitaly Kuznetsov
2014-07-01 15:34   ` Konrad Rzeszutek Wilk

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=20140630162807.GA3529@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=daniel.kiper@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --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 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.