]> git.hungrycats.org Git - linux/commitdiff
[PATCH] 6/6 cacheline align files_lock
authorMartin J. Bligh <mbligh@aracnet.com>
Sat, 8 Mar 2003 02:24:13 +0000 (18:24 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 8 Mar 2003 02:24:13 +0000 (18:24 -0800)
I'm getting a lot of cacheline bounce from .text.lock.file_table due to
false sharing of the cahceline. The following patch just aligns the lock
in it's own cacheline.

fs/file_table.c

index c88f669fd7730eb66313bf09391dd7c83989a838..4e66a3598de85990682fc8c017deb2e1f0a42bfa 100644 (file)
@@ -27,7 +27,7 @@ static LIST_HEAD(anon_list);
 /* And here the free ones sit */
 static LIST_HEAD(free_list);
 /* public *and* exported. Not pretty! */
-spinlock_t files_lock = SPIN_LOCK_UNLOCKED;
+spinlock_t files_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 /* Find an unused file structure and return a pointer to it.
  * Returns NULL, if there are no more free file structures or