All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <jgrall@amazon.com>
To: "Xia, Hongyan" <hongyxia@amazon.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>
Cc: "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"wl@xen.org" <wl@xen.org>,
	"roger.pau@citrix.com" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2 1/2] x86/mm: factor out the code for shattering an l3 PTE
Date: Wed, 11 Dec 2019 11:47:19 +0000	[thread overview]
Message-ID: <275b6932-5f79-033a-0bb8-a3a41159b979@amazon.com> (raw)
In-Reply-To: <eeb762add75c87db90a3c93a35a7f2149e81c6f7.camel@amazon.com>

Hi Hongyan,

On 11/12/2019 11:28, Xia, Hongyan wrote:
> On Wed, 2019-12-11 at 11:10 +0000, Julien Grall wrote:
>> Hi Hongyan,
>> ...
>>
>> While this involves more instructions, how often do we expect the
>> code
>> to be called?
>>
>> Cheers,
>>
> 
> I don't expect this to be called very often in the current Xen.
> Although with direct map removal, a lot of the memory allocations
> (mostly xenheap allocations) will be mapped and unmapped on-demand and
> there is a much higher change of merging/shattering.

Thank you for the explanation. In order to merge/shatter, you need the 
buddy allocator to ensure all the xenheap are allocated contiguously. I 
am pretty unconvinced there are a lot of page allocated via xenheap. So 
the chance to have contiguous xenheap allocation is very limited.

But the merging/shattering can be counterproductive. An example short 
memory allocation (we have a few places like that):
    xmalloc(...);
    do something
    xfree(...);

We would end up to merge and then a few ms later shatter again. So it 
feels to me, that merging is probably not worth it (I am planning to 
discuss with Andrew today about it).

> 
> However, the series moved all PTEs from xenheap to domheap, and we
> might see other things moved to domheap in the future, so we might not
> have many things left on xenheap anyway.

Typesafe is an important part of making our code base more secure than 
basic C (such as not mixing type).

In this case, I think if we start to merge/shatter a lot, then we have a 
bigger problem and we may want to consider to remove it (see above) So 
it feels the optimization is not worth it.

Note that I am not maintaining this code, so the final call is on Andrew 
and Jan.

Cheers,

-- 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-12-11 11:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09 11:48 [Xen-devel] [PATCH v2 0/2] Refactor super page shattering Hongyan Xia
2019-12-09 11:48 ` [Xen-devel] [PATCH v2 1/2] x86/mm: factor out the code for shattering an l3 PTE Hongyan Xia
2019-12-10 15:20   ` Jan Beulich
2019-12-11 10:28     ` Xia, Hongyan
2019-12-11 11:10       ` Julien Grall
2019-12-11 11:28         ` Xia, Hongyan
2019-12-11 11:47           ` Julien Grall [this message]
2019-12-11 11:02     ` Xia, Hongyan
2019-12-09 11:48 ` [Xen-devel] [PATCH v2 2/2] x86/mm: factor out the code for shattering an l2 PTE Hongyan Xia
2019-12-10 15:27   ` Jan Beulich

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=275b6932-5f79-033a-0bb8-a3a41159b979@amazon.com \
    --to=jgrall@amazon.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=hongyxia@amazon.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@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 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.