public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Align VM locks
@ 2001-08-16 17:41 Mark Hemment
  2001-08-16 18:26 ` Andrea Arcangeli
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Hemment @ 2001-08-16 17:41 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

Hi,

  The patch below ensures the pagecache_lock and pagemap_lru_lock aren't
sharing an L1 cacheline with anyone else - espically each other!

Mark


diff -ur -X dontdiff linux-2.4.9-pre4/mm/filemap.c L1-2.4.9-pre4/mm/filemap.c
--- linux-2.4.9-pre4/mm/filemap.c	Thu Aug 16 15:57:51 2001
+++ L1-2.4.9-pre4/mm/filemap.c	Thu Aug 16 18:28:24 2001
@@ -45,12 +45,12 @@
 unsigned int page_hash_bits;
 struct page **page_hash_table;

-spinlock_t pagecache_lock = SPIN_LOCK_UNLOCKED;
+spinlock_t __cacheline_aligned pagecache_lock = SPIN_LOCK_UNLOCKED;
 /*
  * NOTE: to avoid deadlocking you must never acquire the pagecache_lock with
  *       the pagemap_lru_lock held.
  */
-spinlock_t pagemap_lru_lock = SPIN_LOCK_UNLOCKED;
+spinlock_t __cacheline_aligned pagemap_lru_lock = SPIN_LOCK_UNLOCKED;

 #define CLUSTER_PAGES		(1 << page_cluster)
 #define CLUSTER_OFFSET(x)	(((x) >> page_cluster) << page_cluster)


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-08-16 23:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-16 17:41 [PATCH] Align VM locks Mark Hemment
2001-08-16 18:26 ` Andrea Arcangeli
2001-08-16 18:44   ` Mark Hemment
2001-08-16 18:52     ` Andrea Arcangeli
2001-08-16 18:57       ` Andrea Arcangeli
2001-08-16 19:46       ` Mark Hemment
2001-08-16 20:27         ` Ben LaHaise
2001-08-16 23:35           ` Andrea Arcangeli
2001-08-16 19:14   ` Andrew Morton
2001-08-16 23:33     ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox