summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexander Motin <[email protected]>2021-06-10 12:42:31 -0400
committerBrian Behlendorf <[email protected]>2021-06-10 10:50:16 -0700
commit57196f8ae9323e92cb85a9f9b0c29b01775eee88 (patch)
treee84b840da54af15769509dae0e87b4ed9b196f09 /include
parent8dc540ae1601e4075da64ded1cb75406c4969f87 (diff)
Re-embed multilist_t storage
This commit partially reverts changes to multilists in PR 7968 (multi-threaded spa-sync()) and adds some cache line alignments to separate read-only multilists and heavily modified refcount's to different cache lines. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored-by: iXsystems, Inc. Closes #12158
Diffstat (limited to 'include')
-rw-r--r--include/sys/arc_impl.h12
-rw-r--r--include/sys/dmu_objset.h4
-rw-r--r--include/sys/metaslab_impl.h2
-rw-r--r--include/sys/multilist.h3
4 files changed, 11 insertions, 10 deletions
diff --git a/include/sys/arc_impl.h b/include/sys/arc_impl.h
index 94123fc10..c01da46e0 100644
--- a/include/sys/arc_impl.h
+++ b/include/sys/arc_impl.h
@@ -74,20 +74,20 @@ typedef struct arc_state {
/*
* list of evictable buffers
*/
- multilist_t *arcs_list[ARC_BUFC_NUMTYPES];
+ multilist_t arcs_list[ARC_BUFC_NUMTYPES];
+ /*
+ * supports the "dbufs" kstat
+ */
+ arc_state_type_t arcs_state;
/*
* total amount of evictable data in this state
*/
- zfs_refcount_t arcs_esize[ARC_BUFC_NUMTYPES];
+ zfs_refcount_t arcs_esize[ARC_BUFC_NUMTYPES] ____cacheline_aligned;
/*
* total amount of data in this state; this includes: evictable,
* non-evictable, ARC_BUFC_DATA, and ARC_BUFC_METADATA.
*/
zfs_refcount_t arcs_size;
- /*
- * supports the "dbufs" kstat
- */
- arc_state_type_t arcs_state;
} arc_state_t;
typedef struct arc_callback arc_callback_t;
diff --git a/include/sys/dmu_objset.h b/include/sys/dmu_objset.h
index a8cb81271..e89ee64ea 100644
--- a/include/sys/dmu_objset.h
+++ b/include/sys/dmu_objset.h
@@ -153,7 +153,7 @@ struct objset {
/* no lock needed: */
struct dmu_tx *os_synctx; /* XXX sketchy */
zil_header_t os_zil_header;
- multilist_t *os_synced_dnodes;
+ multilist_t os_synced_dnodes;
uint64_t os_flags;
uint64_t os_freed_dnodes;
boolean_t os_rescan_dnodes;
@@ -172,7 +172,7 @@ struct objset {
/* Protected by os_lock */
kmutex_t os_lock;
- multilist_t *os_dirty_dnodes[TXG_SIZE];
+ multilist_t os_dirty_dnodes[TXG_SIZE];
list_t os_dnodes;
list_t os_downgraded_dbufs;
diff --git a/include/sys/metaslab_impl.h b/include/sys/metaslab_impl.h
index 3be0c466c..9924c3ba0 100644
--- a/include/sys/metaslab_impl.h
+++ b/include/sys/metaslab_impl.h
@@ -206,7 +206,7 @@ struct metaslab_class {
* List of all loaded metaslabs in the class, sorted in order of most
* recent use.
*/
- multilist_t *mc_metaslab_txg_list;
+ multilist_t mc_metaslab_txg_list;
metaslab_class_allocator_t mc_allocator[];
};
diff --git a/include/sys/multilist.h b/include/sys/multilist.h
index 0c7b4075d..26f37c37a 100644
--- a/include/sys/multilist.h
+++ b/include/sys/multilist.h
@@ -71,8 +71,9 @@ struct multilist {
multilist_sublist_index_func_t *ml_index_func;
};
+void multilist_create(multilist_t *, size_t, size_t,
+ multilist_sublist_index_func_t *);
void multilist_destroy(multilist_t *);
-multilist_t *multilist_create(size_t, size_t, multilist_sublist_index_func_t *);
void multilist_insert(multilist_t *, void *);
void multilist_remove(multilist_t *, void *);