Fix/improve dbuf hits accounting
commitcfe8e960f193d69a87693474de666025736f16aa
authorAlexander Motin <mav@FreeBSD.org>
Tue, 17 Aug 2021 15:50:31 +0000 (17 11:50 -0400)
committerGitHub <noreply@github.com>
Tue, 17 Aug 2021 15:50:31 +0000 (17 09:50 -0600)
treeca7d975457a86a43d3123cc34c947ff8cbc285ad
parent7f9d9e6f39fdcbd048b5f9991186da2e14d8139c
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>
Sponsored-By: iXsystems, Inc.
Closes #12422
include/os/linux/zfs/sys/trace_arc.h
include/sys/arc_impl.h
module/zfs/arc.c