mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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 <behlendorf1@llnl.gov> Reviewed-by: Matt Ahrens <matt@delphix.com> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored-By: iXsystems, Inc. Closes #9949
This commit is contained in:
@@ -372,6 +372,13 @@ struct dnode {
|
||||
struct zfetch dn_zfetch;
|
||||
};
|
||||
|
||||
/*
|
||||
* Since AVL already has embedded element counter, use dn_dbufs_count
|
||||
* only for dbufs not counted there (bonus buffers) and just add them.
|
||||
*/
|
||||
#define DN_DBUFS_COUNT(dn) ((dn)->dn_dbufs_count + \
|
||||
avl_numnodes(&(dn)->dn_dbufs))
|
||||
|
||||
/*
|
||||
* We use this (otherwise unused) bit to indicate if the value of
|
||||
* dn_next_maxblkid[txgoff] is valid to use in dnode_sync().
|
||||
|
||||
Reference in New Issue
Block a user