diff options
author | Alexander Motin <[email protected]> | 2020-02-13 14:20:42 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-13 11:20:42 -0800 |
commit | 465e4e795ee3cbdc5de862b26d81b2f1116733df (patch) | |
tree | 0848a222d5ae27a1a623856540aca148ff3c031a /module/zfs/dbuf.c | |
parent | 610eec452d723bc53ce531095aff9577a2e0dc93 (diff) |
Remove duplicate dbufs accounting
Since AVL already has embedded element counter, use dn_dbufs_count
only for dbufs not counted there (bonus buffers) and just add them.
This removes two atomics per dbuf life cycle.
According to profiler it reduces time spent by dbuf_destroy() inside
bottlenecked dbuf_evict_thread() from 13.36% to 9.20% of the core.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Matt Ahrens <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Closes #9949
Diffstat (limited to 'module/zfs/dbuf.c')
-rw-r--r-- | module/zfs/dbuf.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index bafc30e62..1a6098849 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -2688,7 +2688,6 @@ dbuf_destroy(dmu_buf_impl_t *db) mutex_enter_nested(&dn->dn_dbufs_mtx, NESTED_SINGLE); avl_remove(&dn->dn_dbufs, db); - atomic_dec_32(&dn->dn_dbufs_count); membar_producer(); DB_DNODE_EXIT(db); if (needlock) @@ -2912,7 +2911,6 @@ dbuf_create(dnode_t *dn, uint8_t level, uint64_t blkid, ASSERT(dn->dn_object == DMU_META_DNODE_OBJECT || zfs_refcount_count(&dn->dn_holds) > 0); (void) zfs_refcount_add(&dn->dn_holds, db); - atomic_inc_32(&dn->dn_dbufs_count); dprintf_dbuf(db, "db=%p\n", db); |