Messages in this thread | | | Date | Mon, 29 Oct 2001 09:13:22 -0800 (PST) | From | Linus Torvalds <> | Subject | Re: Pls apply this spinlock patch to the kernel |
| |
On Mon, 29 Oct 2001, Juergen Doelle wrote: > > I had created a patch for improving the spinlock behavior on IA32 SMP > systems for file system work load created with dbench > (ftp://samba.org/pub/tridge/dbench). The work load is a mix of create, > delete, write, and read operations executed from a scalable number of > clients. It is mainly handled in buffer cache.
Fair enough. However, I wonder why you didn't just use the existing (unaligned) types, and then on a lock-by-lock basis just mark them aligned. That implies no code-changes.
Something like this should do it:
.. regular "spinlock_t" type
#define cachealign \ __attribute__((section("aligned"),__aligned__(SMP_CACHELINE_SIZE)))
(use a separate section so that subsequent data structures are also guaranteed to be aligned - otherwise you might get false sharing from non-aligned data structures that follow this one).
Eh?
Yes, we already try to do something like this, but due to the false sharing with other stuff it doesn't _guarantee_ an exclusive cacheline. Sometimes that is what you want (ie once you get the lock, it _can_ be advantageous to have the hottest data structure associated with the lock be in the same cacheline)
Linus
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |