svn commit: r205264 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Kip Macy kmacy at FreeBSD.org
Wed Mar 17 21:10:09 UTC 2010


Author: kmacy
Date: Wed Mar 17 21:10:09 2010
New Revision: 205264
URL: http://svn.freebsd.org/changeset/base/205264

Log:
  - cache line align arcs_lock array (h/t Marius Nuennerich)
  - fix ARCS_LOCK_PAD to use architecture defined CACHE_LINE_SIZE
  - cache line align buf_hash_table ht_locks array
  
  MFC after:	7 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Mar 17 21:00:39 2010	(r205263)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Mar 17 21:10:09 2010	(r205264)
@@ -224,7 +224,7 @@ extern kmem_cache_t	*zio_data_buf_cache[
  * second level ARC benefit from these fast lookups.
  */
 
-#define	ARCS_LOCK_PAD		128
+#define	ARCS_LOCK_PAD		CACHE_LINE_SIZE
 struct arcs_lock {
 	kmutex_t	arcs_lock;
 #ifdef _KERNEL
@@ -244,7 +244,7 @@ typedef struct arc_state {
 	uint64_t arcs_lsize[ARC_BUFC_NUMTYPES];	/* amount of evictable data */
 	uint64_t arcs_size;	/* total amount of data in this state */
 	list_t	arcs_lists[ARC_BUFC_NUMLISTS]; /* list of evictable buffers */
-	struct arcs_lock arcs_locks[ARC_BUFC_NUMLISTS] __aligned(128);
+	struct arcs_lock arcs_locks[ARC_BUFC_NUMLISTS] __aligned(CACHE_LINE_SIZE);
 } arc_state_t;
 
 #define ARCS_LOCK(s, i) &((s)->arcs_locks[(i)].arcs_lock)
@@ -581,7 +581,7 @@ struct ht_lock {
 typedef struct buf_hash_table {
 	uint64_t ht_mask;
 	arc_buf_hdr_t **ht_table;
-	struct ht_lock ht_locks[BUF_LOCKS];
+	struct ht_lock ht_locks[BUF_LOCKS] __aligned(CACHE_LINE_SIZE);
 } buf_hash_table_t;
 
 static buf_hash_table_t buf_hash_table;


More information about the svn-src-head mailing list