git: sbin/fsck_hammer2: Add -c to cache subtree blockref stats for speed

Tomohiro Kusumi tkusumi at
Wed Oct 30 09:07:11 PDT 2019

commit 958de67287616dba143fd3ee1fd2e649e89138ab
Author: Tomohiro Kusumi <kusumi.tomohiro at>
Date:   Wed Oct 30 02:30:31 2019 +0900

    sbin/fsck_hammer2: Add -c to cache subtree blockref stats for speed
    If blockref scan succeeds and subtree blockref count exceeds a -c
    value, cache subtree blockref stats and blockref itself.
    This greatly improves speed when multiple PFSes share large parts
    of blockrefs via snapshots. If blockrefs were somehow corrupted in
    a weird way that exact same copies of blockref appear more than once,
    this doesn't work, but should generally be useful.
    Note that using a too small -c value may eat memory without much
    performance improvement. Also note that using a too large -c value
    saves memory but blockrefs may not be cached or used.
    A suitable -c value depends on blockref tree structure since it's
    a threshold for blockref count. A fs with more than a few GB of
    consumption, should use a few thousand or more.

Summary of changes:
 sbin/fsck_hammer2/fsck_hammer2.8 |   5 +-
 sbin/fsck_hammer2/fsck_hammer2.c |  17 ++-
 sbin/fsck_hammer2/fsck_hammer2.h |   1 +
 sbin/fsck_hammer2/test.c         | 246 +++++++++++++++++++++++++++++++--------
 4 files changed, 220 insertions(+), 49 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list