From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Keir Fraser <keir@xen.org>,
Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH RFC] xen: prevent PVH Dom0 from having pages with more than one ref
Date: Fri, 13 Jun 2014 10:23:53 +0100 [thread overview]
Message-ID: <539AC329.3050109@citrix.com> (raw)
In-Reply-To: <1402650748-61744-1-git-send-email-roger.pau@citrix.com>
On 13/06/14 10:12, Roger Pau Monne wrote:
> With the current implementation of the Dom0 domain builder a PVH Dom0
> ends up with pages that have 2 references, which means they are not
> freed when Dom0 balloons memory down. This leads to those pages
> not being freed in guest_remove_page, so they are leaked and the
> memory accounting between Xen and Dom0 differs, because Dom0 OS
> actually thinks they are freed, but d->tot_pages is not decreased.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> Cc: Keir Fraser <keir@xen.org>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Mukesh Rathor <mukesh.rathor@oracle.com>
> ---
In which scenarios do pages get two refs, and why do you consider this
to be valid?
(Or in other words, my gut feel is that this patch is wrong, but there
is insufficient information to decide one way or another.)
~Andrew
> xen/arch/x86/domain_build.c | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
> index ba42fc9..7073dac 100644
> --- a/xen/arch/x86/domain_build.c
> +++ b/xen/arch/x86/domain_build.c
> @@ -1137,10 +1137,12 @@ int __init construct_dom0(
> L1_PROT : COMPAT_L1_PROT));
> l1tab++;
>
> - page = mfn_to_page(mfn);
> - if ( (page->u.inuse.type_info == 0) &&
> - !get_page_and_type(page, d, PGT_writable_page) )
> - BUG();
> + if ( !is_pvh_domain(d) ) {
> + page = mfn_to_page(mfn);
> + if ( (page->u.inuse.type_info == 0) &&
> + !get_page_and_type(page, d, PGT_writable_page) )
> + BUG();
> + }
> }
>
> if ( is_pv_32on64_domain(d) )
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-06-13 9:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-13 9:12 [PATCH RFC] xen: prevent PVH Dom0 from having pages with more than one ref Roger Pau Monne
2014-06-13 9:23 ` Andrew Cooper [this message]
2014-06-13 10:17 ` Roger Pau Monné
2014-06-13 11:05 ` Jan Beulich
2014-06-13 11:16 ` Andrew Cooper
2014-06-13 11:39 ` Jan Beulich
2014-06-13 11:16 ` Roger Pau Monné
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=539AC329.3050109@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=roger.pau@citrix.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.