[patch] Cache align futex hash buckets

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

 



Following change places each element of the futex_queues hashtable on a 
different cacheline.  Spinlocks of adjacent hash buckets lie on the same 
cacheline otherwise.

Signed-off-by: Ravikiran Thirumalai <[email protected]>
Signed-off-by: Shai Fultheim <[email protected]>

Index: linux-2.6.16-rc2/kernel/futex.c
===================================================================
--- linux-2.6.16-rc2.orig/kernel/futex.c	2006-02-07 23:14:04.000000000 -0800
+++ linux-2.6.16-rc2/kernel/futex.c	2006-02-09 14:04:22.000000000 -0800
@@ -100,9 +100,10 @@ struct futex_q {
 struct futex_hash_bucket {
        spinlock_t              lock;
        struct list_head       chain;
-};
+} ____cacheline_internodealigned_in_smp;
 
-static struct futex_hash_bucket futex_queues[1<<FUTEX_HASHBITS];
+static struct futex_hash_bucket futex_queues[1<<FUTEX_HASHBITS] 
+				__cacheline_aligned_in_smp;
 
 /* Futex-fs vfsmount entry: */
 static struct vfsmount *futex_mnt;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux