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

Re: [Xen-devel] [PATCH 2/3] x86/mem_sharing: replace use of page_lock/unlock with our own lock



>>> On 25.04.19 at 21:57, <tamas@xxxxxxxxxxxxx> wrote:
> On Thu, Apr 25, 2019 at 12:58 PM Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx> wrote:
>>
>> On 25/04/2019 16:32, Tamas K Lengyel wrote:
>> > diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
>> > index 6faa563167..594de6148f 100644
>> > --- a/xen/include/asm-x86/mm.h
>> > +++ b/xen/include/asm-x86/mm.h
>> > @@ -133,7 +133,10 @@ struct page_info
>> >           * of sharing share the version they expect to.
>> >           * This list is allocated and freed when a page is 
> shared/unshared.
>> >           */
>> > -        struct page_sharing_info *sharing;
>> > +        struct {
>> > +            struct page_sharing_info *info;
>> > +            rwlock_t lock;
>> > +        } sharing;
>> >      };
>> >
>> >      /* Reference count and various PGC_xxx flags and fields. */
>>
>> I'm afraid this is a no-go, but for some reasons which are rather more
>> subtle that they appear here.
>>
>> There is one struct page_info per 4k frame, and you've added an extra 16
>> bytes, taking it from 32 bytes to 48 bytes.
>>
>> Other than making it a non-power-of-2 (net diffstat grow/shrink: 256/27
>> up/down: 7750/-5696 (2054) due to less efficient arithmetic[1]), the
>> framtable has a fixed virtual size (128G by default), so you've ended up
>> dropping Xen's memory limit (16TB by default) by 1/3.
> 
> Interesting, I'm not sure I completely follow but does this mean that
> this structure is now not allowed to grow, like ever, or that I just
> need to add padding to fix up its alignment?

In addition to what Andrew has said, also notice how we've gone
through extra hoops to avoid growing the structure in the context
of XSA-280.

Jan



_______________________________________________
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®.