[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E55707A.2080102@goop.org>
Date: Wed, 24 Aug 2011 14:43:22 -0700
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: Andi Kleen <andi@...stfloor.org>, "H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...e.hu>,
the arch/x86 maintainers <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Nick Piggin <npiggin@...nel.dk>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists