[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 1/2] x86/mm: factor out the code for shattering an l3 PTE

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
to be called?


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):
   do something

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.



Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.