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

Re: [Xen-devel] [PATCHv6 3/5] gnttab: split grant table lock into table and maptrack locks



>>> David Vrabel <david.vrabel@xxxxxxxxxx> 04/29/15 12:54 PM >>>
>On 23/04/15 16:04, Jan Beulich wrote:
>>> --- a/xen/include/xen/grant_table.h
>>> +++ b/xen/include/xen/grant_table.h
>>> @@ -82,7 +82,12 @@ struct grant_table {
>>>      struct grant_mapping **maptrack;
>>>      unsigned int          maptrack_head;
>>>      unsigned int          maptrack_limit;
>>> -    /* Lock protecting updates to active and shared grant tables. */
>>> +    /* Lock protecting the maptrack page list, head, and limit */
>>> +    spinlock_t            maptrack_lock;
>>> +    /* 
>>> +     * Lock protecting updates to grant table state (version, active
>>> +     * entry list, etc.)
>>> +     */
>>>      spinlock_t            lock;
>> 
>> If the patch still was to be applied, these two locks should be put
>> on separate cache lines, to avoid unnecessary bouncing.
>
>I was shuffling the fields around to make this happen and I ended up
>shrinking the structure to fit it in a single cache line instead.
>
>Shall I add some explicit padding to get the alignment you want?  Note
>that with the per-CPU maptrack free lists the maptrack lock isn't
>heavily contended.

Ah, right. In that case artificially bloating the structure is likely not worth
it.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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