[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



On Tue, 2019-12-10 at 16:20 +0100, Jan Beulich wrote:
> 
>         ol2e = l2e_from_intpte(
>                    l2e_get_intpte(ol2e) + (PAGE_SIZE <<
> PAGETABLE_ORDER));
> 
> Of course, as mentioned before, I'm not overly happy to see type
> safety lost in case like this one, where it's not needed like e.g.
> further up to convert from L3 to L2 entry.
> 

Okay, so I did a comparison between the efficiency of the assembly
under a release build.

The old "type-safe" way requires 16 instructions to prepare the first
l2e, and each iteration of the inner loop of populating l2t requires 7
instructions.

The new type-unsafe way requires 6 to prepare the first l2e, and each
iteration of populating l2t takes 5 instructions.

So the difference of populating l2t is 3600 vs. 2566 instructions,
which is not very small.

I have not tested the packed bit field way you suggested, but I think
it could even be higher than 3600 due to masking, shifting and also
overflow handling.

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

 


Rackspace

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