From 157ef7f6a527239e3cb3afa3be2acf502794a5d4 Mon Sep 17 00:00:00 2001 From: Tom Caputi Date: Sat, 24 Mar 2018 00:35:19 -0400 Subject: [PATCH] Don't count embedded bps in read stats Currently, ZFS tracks statistics about calls to arc_read() via the /proc/spl/kstat/zfs//reads file for debugging. Unfortunately, this file currently counts embedded bps as disk reads since they are technically processed by the ZIO layer. This pollutes the log since the ARC will never cache embedded bps. This patch corrects this issue by preventing the logging of embedded bp reads. Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Signed-off-by: Tom Caputi Closes #7334 --- module/zfs/arc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 9c0c5513d..350aafa1f 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -6346,7 +6346,9 @@ top: } out: - spa_read_history_add(spa, zb, *arc_flags); + /* embedded bps don't actually go to disk */ + if (!BP_IS_EMBEDDED(bp)) + spa_read_history_add(spa, zb, *arc_flags); return (rc); } -- 2.40.0