git: hammer2 - recover, improve performance for media pass (2)
Matthew Dillon
dillon at crater.dragonflybsd.org
Fri Sep 29 22:06:54 PDT 2023
commit c255364f1c6040d46b31b408da72831044c7d457
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Fri Sep 29 22:00:37 2023 -0700
hammer2 - recover, improve performance for media pass (2)
* Add a negative bref cache. When enter_inode() fails after having
done an I/O, it records the bref. If presented with a recorded bref,
again enter_inode() will return immediately without doing a useless
duplicate I/O.
Duplicates can easily arise for many reasons, including the simple
fact that we are doing a media scan without a lot of the topological
context that the real filesystem would otherwise use.
* Requires a little bit of nuance. An inode entry does not necessarily
fail because the inode on the media is corrupt. It can easily be the
bref that is corrupt, and the scan may encounter many brefs pointing
to the same inode (data_off) on the media.
So we have to match several fields in the bref to ensure that we are
properly filtering-out duplicates.
* This mechanism reports "Invalid_hits" which is basically the number
of bad brefs presented to enter_inode() that resulted in an avoided
I/O. This is typically a fairly large number, indicating improved
performance for the media scan phase.
Summary of changes:
sbin/hammer2/cmd_recover.c | 103 +++++++++++++++++++++++++++++++++++++++++----
1 file changed, 94 insertions(+), 9 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c255364f1c6040d46b31b408da72831044c7d457
--
DragonFly BSD source repository
More information about the Commits
mailing list