xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Rushton <mvrushton@gmail.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Keir Fraser <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	AndrewCooper <andrew.cooper3@citrix.com>,
	Tim Deegan <tim@xen.org>,
	mrushton@amazon.com, msw@amazon.com, Matt Wilson <msw@linux.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [RFC PATCH] page_alloc: use first half of higher order chunks when halving
Date: Tue, 20 May 2014 12:26:57 -0700	[thread overview]
Message-ID: <537BAC81.1030101@gmail.com> (raw)
In-Reply-To: <20140514150623.GA4732@phenom.dumpdata.com>

On 05/14/14 08:06, Konrad Rzeszutek Wilk wrote:
> On Wed, May 07, 2014 at 04:16:14PM -0700, Matthew Rushton wrote:
>> On 04/16/14 07:15, Konrad Rzeszutek Wilk wrote:
>>> On Mon, Apr 14, 2014 at 04:34:47PM +0100, Jan Beulich wrote:
>>>>>>> On 14.04.14 at 16:40, <konrad.wilk@oracle.com> wrote:
>>>>> That was OK, but the M2P lookup table was not too thrilled with this.
>>>>> Perhaps I should have used another hypercall to re-arrange the M2P?
>>>>> I think I did try 'XENMEM_exchange' but that is not the right call either.
>>>> Yeah, that's allocating new pages in exchange for your old ones. Not
>>>> really what you want.
>>>>
>>>>> Perhaps I should use XENMEM_remove_from_physmap/XENMEM_add_to_physmap
>>>>> combo ?
>>>> A pair of MMU_MACHPHYS_UPDATE operations would seem to be the
>>>> right way of doing this (along with respective kernel internal accounting
>>>> like set_phys_to_machine(), and perhaps a pair of update_va_mapping
>>>> operations if the 1:1 map is already in place at that time, and you care
>>>> about which page contents appears at which virtual address).
>>> OK.
>>>
>>> Matt & Matthew - my plate is quite filled and I fear that in the next three
>>> weeks there is not going to be much time to code up a prototype.
>>>
>>> Would either one of you be willing to take a crack at this? It would
>>> be neat as we could remove a lot of the balloon increase/decrease code
>>> in arch/x86/xen/setup.c.
>>>
>>> Thanks!
>> I have a first pass at this. Just need to test it and should have something
>> ready sometime next week or so.
> Daniel pointed me to this commit:
> ommit 2e2fb75475c2fc74c98100f1468c8195fee49f3b
> Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Date:   Fri Apr 6 10:07:11 2012 -0400
>
>      xen/setup: Populate freed MFNs from non-RAM E820 entries and gaps to E820 RAM
> ..
>      The other solution (that did not work) was to transplant the MFN in
>      the P2M tree - the ones that were going to be freed were put in
>      the E820_RAM regions past the nr_pages. But the modifications to the
>      M2P array (the other side of creating PTEs) were not carried away.
>      As the hypervisor is the only one capable of modifying that and the
>      only two hypercalls that would do this are: the update_va_mapping
>      (which won't work, as during initial bootup only PFNs up to nr_pages
>      are mapped in the guest) or via the populate hypercall.
>
> Where I talk about the 'update_va_mapping' - and I seem to think
> that it would not work (due to the nr_pages limit). I don't actually
> remember the details - so I might have been incorrect (hopefully!?).
>

Ok I finally have something I'm happy with using the mmu_update 
hypercall and placing things in the existing E820 map. I don't think the 
update_va_mapping hypercall is necessary. It ended up being a little 
more complicated than I originally thought to handle not allocating 
additional p2m leaf nodes. I'm going on vacation here shortly and can 
post it when I get back.

>>>> Jan
>>>>

  reply	other threads:[~2014-05-20 19:27 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25 11:22 [RFC PATCH] page_alloc: use first half of higher order chunks when halving Matt Wilson
2014-03-25 11:44 ` Andrew Cooper
2014-03-25 13:20   ` Matt Wilson
2014-03-25 20:18     ` Matthew Rushton
2014-03-25 12:19 ` Tim Deegan
2014-03-25 13:27   ` Matt Wilson
2014-03-25 20:09     ` Matthew Rushton
2014-03-26  9:55       ` Tim Deegan
2014-03-26 10:17         ` Matt Wilson
2014-03-26 10:44           ` David Vrabel
2014-03-26 10:48             ` Matt Wilson
2014-03-26 11:13               ` Ian Campbell
2014-03-26 11:41                 ` Matt Wilson
2014-03-26 11:45                   ` Andrew Cooper
2014-03-26 11:50                     ` Matt Wilson
2014-03-26 12:43               ` David Vrabel
2014-03-26 12:48                 ` Matt Wilson
2014-03-26 15:08           ` Konrad Rzeszutek Wilk
2014-03-26 15:15             ` Matt Wilson
2014-03-26 15:59               ` Matthew Rushton
2014-03-26 16:36                 ` Konrad Rzeszutek Wilk
2014-03-26 17:47                   ` Matthew Rushton
2014-03-26 17:56                     ` Konrad Rzeszutek Wilk
2014-03-26 22:15                       ` Matthew Rushton
2014-03-28 17:02                         ` Konrad Rzeszutek Wilk
2014-03-28 22:06                           ` Matthew Rushton
2014-03-31 14:15                             ` Konrad Rzeszutek Wilk
2014-04-01  3:25                               ` Matthew Rushton
2014-04-01 10:48                                 ` Konrad Rzeszutek Wilk
2014-04-01 12:22                                   ` Tim Deegan
2014-04-02  0:17                                     ` Matthew Rushton
2014-04-02  7:52                                       ` Jan Beulich
2014-04-02 10:06                                         ` Ian Campbell
2014-04-02 10:15                                           ` Jan Beulich
2014-04-02 10:20                                             ` Ian Campbell
2014-04-09 22:21                                               ` Matthew Rushton
2014-04-10  6:14                                                 ` Jan Beulich
2014-04-11 20:20                                                   ` Matthew Rushton
2014-04-11 17:05                                                 ` Konrad Rzeszutek Wilk
2014-04-11 20:28                                                   ` Matthew Rushton
2014-04-12  1:34                                                     ` Konrad Rzeszutek Wilk
2014-04-13 21:32                                                   ` Tim Deegan
2014-04-14  8:51                                                     ` Jan Beulich
2014-04-14 14:40                                                       ` Konrad Rzeszutek Wilk
2014-04-14 15:34                                                         ` Jan Beulich
2014-04-16 14:15                                                           ` Konrad Rzeszutek Wilk
2014-04-17  1:34                                                             ` Matthew Rushton
2014-05-07 23:16                                                             ` Matthew Rushton
2014-05-08 18:05                                                               ` Konrad Rzeszutek Wilk
2014-05-14 15:06                                                               ` Konrad Rzeszutek Wilk
2014-05-20 19:26                                                                 ` Matthew Rushton [this message]
2014-05-23 19:00                                                                   ` Konrad Rzeszutek Wilk
2014-06-04 22:25                                                                     ` Matthew Rushton
2014-06-05  9:32                                                                       ` David Vrabel
2014-03-26 16: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=537BAC81.1030101@gmail.com \
    --to=mvrushton@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=keir@xen.org \
    --cc=konrad.wilk@oracle.com \
    --cc=mrushton@amazon.com \
    --cc=msw@amazon.com \
    --cc=msw@linux.com \
    --cc=tim@xen.org \
    --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 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).