]> git.proxmox.com Git - mirror_zfs.git/commit
Fix ARC stats for embedded blkptrs
authorTim Chase <tim@chase2k.com>
Mon, 4 Feb 2019 17:33:30 +0000 (11:33 -0600)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 4 Feb 2019 17:33:30 +0000 (09:33 -0800)
commit0902c4577f4ba2a3687549f7d5d19718a275fb52
tree9ebbb7f1663f308167df67dd15e4491df020c3e1
parent96342996577aac97fc9eaa0c0a9f74377dc9e336
Fix ARC stats for embedded blkptrs

Re-factor arc_read() to better account for embedded data blkptrs.
Previously, reading the payload from an embedded blkptr would cause
arcstats such as demand_metadata_misses to be bumped when there was
actually no cache "miss" because the data are already available in
the blkptr.

The following test procedure was used to demonstrate the problem:

   zpool create tank ...
   zfs create -o compression=lz4 tank/fs
   echo blah > /tank/fs/blah
   stat /tank/fs/blah
   grep 'meta.*mis' /proc/spl/kstat/zfs/arcstats

and repeating the last two steps to watch the metadata miss counter
increment.  This can also be demonstrated via the  zfs_arc_miss DTRACE4
probe in arc_read().

Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: George Wilson <george.wilson@delphix.com>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Tim Chase <tim@chase2k.com>
Closes #8319
module/zfs/arc.c