Skip to content

Commit

Permalink
Don't count embedded bps in read stats
Browse files Browse the repository at this point in the history
Currently, ZFS tracks statistics about calls to arc_read()
via the /proc/spl/kstat/zfs/<pool>/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 <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #7334
  • Loading branch information
Tom Caputi authored and behlendorf committed Mar 24, 2018
1 parent 387b685 commit 157ef7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6346,7 +6346,9 @@ arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp,
}

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);
}

Expand Down

0 comments on commit 157ef7f

Please sign in to comment.