lkml.org 
[lkml]   [2011]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/18] x86/ticketlock: make __ticket_spin_trylock common
On 08/24/2011 02:38 PM, Linus Torvalds wrote:
> Many data structures have spinlocks inside of them, and the smaller
> spinlock *should* be able to result in smaller data structures.
>
> Of course, that assumes that they have been packed correctly. And they
> seldom are ;(
>
> Looking at 'struct task_struct', for example, the spinlocks there
> aren't next to each other, and have pointers and 'unsigned int's
> around them, so rather than shrinking the data structure, it just
> results in holes.

Wouldn't sticking all the spinlocks together just result in false
sharing? Wouldn't it be best to put them right next to the fields they
protect so the act of getting the lock also gets you your data?

J


\
 
 \ /
  Last update: 2011-08-24 23:45    [from the cache]
©2003-2011 Jasper Spaans