diff options
author | Alexander Motin <[email protected]> | 2021-07-01 11:16:54 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-01 09:16:54 -0600 |
commit | 42afb12da70f1fd73c7fcf653d5e2bf42f05b42b (patch) | |
tree | 34742eff40f1336babe913162a8d8c0715eaa1a9 /include | |
parent | cfc564f9b11eed1421789fa018f7b3d141cc18d0 (diff) |
Remove refcount from spa_config_*()
The only reason for spa_config_*() to use refcount instead of simple
non-atomic (thanks to scl_lock) variable for scl_count is tracking,
hard disabled for the last 8 years. Switch to simple int scl_count
reduces the lock hold time by avoiding atomic, plus makes structure
fit into single cache line, reducing the locks contention.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Matthew Ahrens <[email protected]>
Reviewed-by: Mark Maybee <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Closes #12287
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/spa_impl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sys/spa_impl.h b/include/sys/spa_impl.h index bc88cfa15..280f8cf16 100644 --- a/include/sys/spa_impl.h +++ b/include/sys/spa_impl.h @@ -141,9 +141,9 @@ typedef struct spa_config_lock { kmutex_t scl_lock; kthread_t *scl_writer; int scl_write_wanted; + int scl_count; kcondvar_t scl_cv; - zfs_refcount_t scl_count; -} spa_config_lock_t; +} ____cacheline_aligned spa_config_lock_t; typedef struct spa_config_dirent { list_node_t scd_link; |