xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] [PATCH 1/2] xen/p2m: Fix for 32-bit builds the "Reserve 8MB of _brk space for P2M"
Date: Fri, 17 Aug 2012 14:28:51 +0100	[thread overview]
Message-ID: <502E4713.9050000@citrix.com> (raw)
In-Reply-To: <20120817130621.GC31903@phenom.dumpdata.com>

On 17/08/12 14:06, Konrad Rzeszutek Wilk wrote:
> On Fri, Aug 17, 2012 at 12:14:12PM +0100, David Vrabel wrote:
>> On 16/08/12 22:02, Konrad Rzeszutek Wilk wrote:
>>>
>>> So I thought about this some more and came up with this patch. Its
>>> RFC and going to run it through some overnight tests to see how they fare.
>>>
>>>
>>> commit da858a92dbeb52fb3246e3d0f1dd57989b5b1734
>>> Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>> Date:   Fri Jul 27 16:05:47 2012 -0400
>>>
>>>     xen/p2m: Reuse existing P2M leafs if they are filled with 1:1 PFNs or INVALID.
>>>     
>>>     If P2M leaf is completly packed with INVALID_P2M_ENTRY or with
>>>     1:1 PFNs (so IDENTITY_FRAME type PFNs), we can swap the P2M leaf
>>>     with either a p2m_missing or p2m_identity respectively. The old
>>>     page (which was created via extend_brk or was grafted on from the
>>>     mfn_list) can be re-used for setting new PFNs.
>>
>> Does this actually find any p2m pages to reclaim?
> 
> Very much so. When I run the kernel without dom0_mem, and end up returning
> around 372300 pages back, and then populating them back - they (mostly)
> all get to re-use the transplanted mfn_list.
> 
> The ones in the 9a-100 obviously don't.
>>
>> xen_set_identity_and_release() is careful to set the largest possible
>> range as 1:1 and the comments at the top of p2m.c suggest the mid
>> entries will be made to point to p2m_identity already.
> 
> Right, and that is still true - for cases where the are no mid entries
> (so P2M[3][400] for example can point in the middle of the MMIO region).
> 
> But if you boot without dom0_mem=max, that region (P2M[3][400]) would at
> the start be backed by the &mfn_list, so when we call 1-1 on that region
> it ends up sticking in the &mfn_list a whole bunch of IDENTITY_FRAME(pfn).

Ah, I see.  This makes sense now.

> This patch harvests those chunks of &mfn_list that have that and re-uses them.
> 
> And without any dom0_mem= I seem to at most call extend_bkr twice (to
> allocate the top leafs P2M[4] and P2M[5]). Hm, to be on a safe side I should
> probably do 'reserve_brk(p2m_popualated, 3 * PAGE_SIZE)' in case we
> end up transplanting 3GB of PFNs in in the P2M[4], P2M[5] and P2M[6] nodes.

That sounds sensible.

David

  reply	other threads:[~2012-08-17 13:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16 15:50 [PATCH] Fixes for v3.6 (v1) Konrad Rzeszutek Wilk
2012-08-16 15:50 ` [PATCH 1/2] xen/p2m: Fix for 32-bit builds the "Reserve 8MB of _brk space for P2M" Konrad Rzeszutek Wilk
2012-08-16 17:32   ` [Xen-devel] " Konrad Rzeszutek Wilk
2012-08-16 21:02     ` Konrad Rzeszutek Wilk
2012-08-17 11:14       ` David Vrabel
2012-08-17 13:06         ` Konrad Rzeszutek Wilk
2012-08-17 13:28           ` David Vrabel [this message]
2012-08-17 17:36             ` Konrad Rzeszutek Wilk
2012-08-16 15:50 ` [PATCH 2/2] Revert "xen PVonHVM: move shared_info to MMIO before kexec" 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=502E4713.9050000@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /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).