diff options
author | Alexander Motin <[email protected]> | 2020-02-05 14:08:44 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-05 11:08:44 -0800 |
commit | cbd8f5b759a7903a04aa38d858bb36f5dac19cb5 (patch) | |
tree | 0c4c88a3e2a286d37af575bd5c2a543dcdbcc246 /include/sys/dbuf.h | |
parent | cccbed9f98597c2c354b218b0578625cc26358aa (diff) |
Few microoptimizations to dbuf layer
Move db_link into the same cache line as db_blkid and db_level.
It allows significantly reduce avl_add() time in dbuf_create() on
systems with large RAM and huge number of dbufs per dnode.
Avoid few accesses to dbuf_caches[].size, which is highly congested
under high IOPS and never stays in cache for a long time. Use local
value we are receiving from zfs_refcount_add_many() any way.
Remove cache_size_bytes_max bump from dbuf_evict_one(). I don't see
a point to do it on dbuf eviction after we done it on insertion in
dbuf_rele_and_unlock().
Reviewed-by: Matt Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Closes #9931
Diffstat (limited to 'include/sys/dbuf.h')
-rw-r--r-- | include/sys/dbuf.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/sys/dbuf.h b/include/sys/dbuf.h index f6880cdb2..d04e08baa 100644 --- a/include/sys/dbuf.h +++ b/include/sys/dbuf.h @@ -206,6 +206,13 @@ typedef struct dmu_buf_impl { */ struct dmu_buf_impl *db_hash_next; + /* + * Our link on the owner dnodes's dn_dbufs list. + * Protected by its dn_dbufs_mtx. Should be on the same cache line + * as db_level and db_blkid for the best avl_add() performance. + */ + avl_node_t db_link; + /* our block number */ uint64_t db_blkid; @@ -260,12 +267,6 @@ typedef struct dmu_buf_impl { /* List of dirty records for the buffer sorted newest to oldest. */ list_t db_dirty_records; - /* - * Our link on the owner dnodes's dn_dbufs list. - * Protected by its dn_dbufs_mtx. - */ - avl_node_t db_link; - /* Link in dbuf_cache or dbuf_metadata_cache */ multilist_node_t db_cache_link; |