mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 11:47:43 +03:00
Revert "Reduce dbuf_find() lock contention"
This reverts commit 34dbc618f5. While this
change resolved the lock contention observed for certain workloads, it
inadventantly reduced the maximum hash inserts/removes per second. This
appears to be due to the slightly higher acquisition cost of a rwlock vs
a mutex.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
@@ -137,7 +137,7 @@ dbuf_stats_hash_table_data(char *buf, size_t size, void *data)
|
||||
if (size)
|
||||
buf[0] = 0;
|
||||
|
||||
rw_enter(DBUF_HASH_RWLOCK(h, dsh->idx), RW_READER);
|
||||
mutex_enter(DBUF_HASH_MUTEX(h, dsh->idx));
|
||||
for (db = h->hash_table[dsh->idx]; db != NULL; db = db->db_hash_next) {
|
||||
/*
|
||||
* Returning ENOMEM will cause the data and header functions
|
||||
@@ -158,7 +158,7 @@ dbuf_stats_hash_table_data(char *buf, size_t size, void *data)
|
||||
|
||||
mutex_exit(&db->db_mtx);
|
||||
}
|
||||
rw_exit(DBUF_HASH_RWLOCK(h, dsh->idx));
|
||||
mutex_exit(DBUF_HASH_MUTEX(h, dsh->idx));
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user