mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Fix/improve dbuf hits accounting
Instead of clearing stats inside arc_buf_alloc_impl() do it inside arc_hdr_alloc() and arc_release(). It fixes statistics being wiped every time a new dbuf is filled from the ARC. Remove b_l1hdr.b_l2_hits. L2ARC hits are accounted at b_l2hdr.b_hits. Since the hits are accounted under hash lock, replace atomics with simple increments. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Wilson <george.wilson@delphix.com> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Closes #12422
This commit is contained in:
committed by
Tony Hutter
parent
c600f0687f
commit
40e02f49e9
@@ -80,7 +80,7 @@ DECLARE_EVENT_CLASS(zfs_arc_buf_hdr_class,
|
||||
__entry->hdr_mru_ghost_hits = ab->b_l1hdr.b_mru_ghost_hits;
|
||||
__entry->hdr_mfu_hits = ab->b_l1hdr.b_mfu_hits;
|
||||
__entry->hdr_mfu_ghost_hits = ab->b_l1hdr.b_mfu_ghost_hits;
|
||||
__entry->hdr_l2_hits = ab->b_l1hdr.b_l2_hits;
|
||||
__entry->hdr_l2_hits = ab->b_l2hdr.b_hits;
|
||||
__entry->hdr_refcount = ab->b_l1hdr.b_refcnt.rc_count;
|
||||
),
|
||||
TP_printk("hdr { dva 0x%llx:0x%llx birth %llu "
|
||||
@@ -238,7 +238,7 @@ DECLARE_EVENT_CLASS(zfs_arc_miss_class,
|
||||
__entry->hdr_mru_ghost_hits = hdr->b_l1hdr.b_mru_ghost_hits;
|
||||
__entry->hdr_mfu_hits = hdr->b_l1hdr.b_mfu_hits;
|
||||
__entry->hdr_mfu_ghost_hits = hdr->b_l1hdr.b_mfu_ghost_hits;
|
||||
__entry->hdr_l2_hits = hdr->b_l1hdr.b_l2_hits;
|
||||
__entry->hdr_l2_hits = hdr->b_l2hdr.b_hits;
|
||||
__entry->hdr_refcount = hdr->b_l1hdr.b_refcnt.rc_count;
|
||||
|
||||
__entry->bp_dva0[0] = bp->blk_dva[0].dva_word[0];
|
||||
|
||||
@@ -153,24 +153,22 @@ typedef struct l1arc_buf_hdr {
|
||||
kmutex_t b_freeze_lock;
|
||||
zio_cksum_t *b_freeze_cksum;
|
||||
|
||||
arc_buf_t *b_buf;
|
||||
uint32_t b_bufcnt;
|
||||
/* for waiting on writes to complete */
|
||||
/* for waiting on reads to complete */
|
||||
kcondvar_t b_cv;
|
||||
uint8_t b_byteswap;
|
||||
|
||||
|
||||
/* protected by arc state mutex */
|
||||
arc_state_t *b_state;
|
||||
multilist_node_t b_arc_node;
|
||||
|
||||
/* updated atomically */
|
||||
/* protected by hash lock */
|
||||
clock_t b_arc_access;
|
||||
uint32_t b_mru_hits;
|
||||
uint32_t b_mru_ghost_hits;
|
||||
uint32_t b_mfu_hits;
|
||||
uint32_t b_mfu_ghost_hits;
|
||||
uint32_t b_l2_hits;
|
||||
uint32_t b_bufcnt;
|
||||
arc_buf_t *b_buf;
|
||||
|
||||
/* self protecting */
|
||||
zfs_refcount_t b_refcnt;
|
||||
|
||||
Reference in New Issue
Block a user