summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2010-03-17 21:10:09 +0000
committerkmacy <kmacy@FreeBSD.org>2010-03-17 21:10:09 +0000
commite10aea9e476e0d0ac8290a4c44432e34d2280aac (patch)
tree518e492906e2c1301f17111e800142d4a1214cf0
parentf45376263d006db4e4b87b859064eea9dbf7a0e9 (diff)
downloadFreeBSD-src-e10aea9e476e0d0ac8290a4c44432e34d2280aac.zip
FreeBSD-src-e10aea9e476e0d0ac8290a4c44432e34d2280aac.tar.gz
- 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
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
index a9c14b6..ca8ffb1 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
@@ -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;
OpenPOWER on IntegriCloud