mirror of
https://github.com/Zygo/bees.git
synced 2025-07-03 17:12:26 +02:00
roots: filter out obsolete extents from extent refs
When an extent ref is modified, all of the refs in the same metadata page get the same transid in the TREE_SEARCH_V2 header. All of the extents are rescanned by later subvol scans. This causes up to 80% overhead due to redundant reads of the same extents. A proper fix for this requires extent-based scanning instead of extent-ref-based scanning. Until that happens, filter out new references to old extents. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -742,13 +742,24 @@ BeesCrawl::fetch_extents()
|
|||||||
if (gen < get_state().m_min_transid) {
|
if (gen < get_state().m_min_transid) {
|
||||||
BEESCOUNT(crawl_gen_low);
|
BEESCOUNT(crawl_gen_low);
|
||||||
++count_low;
|
++count_low;
|
||||||
// We probably want (need?) to scan these anyway.
|
// We want (need?) to scan these anyway?
|
||||||
// continue;
|
// The header generation refers to the transid
|
||||||
|
// of the metadata page holding the current ref.
|
||||||
|
// This includes anything else in that page that
|
||||||
|
// happened to be modified, regardless of how
|
||||||
|
// old it is.
|
||||||
|
// The file_extent_generation refers to the
|
||||||
|
// transid of the extent item's page, which is
|
||||||
|
// a different approximation of what we want.
|
||||||
|
// Combine both of these filters to minimize
|
||||||
|
// the number of times we unnecessarily re-read
|
||||||
|
// an extent.
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if (gen > get_state().m_max_transid) {
|
if (gen > get_state().m_max_transid) {
|
||||||
BEESCOUNT(crawl_gen_high);
|
BEESCOUNT(crawl_gen_high);
|
||||||
++count_high;
|
++count_high;
|
||||||
// This shouldn't ever happen
|
// This shouldn't ever happen...and so far, doesn't.
|
||||||
// continue;
|
// continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user