From d4b3836493213fa47c1c583102dc6fb0a86be930 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Wed, 26 Sep 2018 22:44:59 -0400 Subject: [PATCH] extentwalker: don't fetch absurd numbers of extents just to throw them away ExtentWalker doesn't gain significant benefits from caching, and the extra SEARCH_V2 ioctls were blamed for a 33% kernel CPU overhead by perf. Reduce the number of extents to 16 in lieu of fixing the caching. This gives a significant speed boost on CPU-bound workloads compared to the original 1024--almost 40% faster on a single SSD with a filesystem consisting of raw VM images mounted with compress=zstd. This also seems to reduce LOGICAL_INO overhead. Perhaps SEARCH_V2 and LOGICAL_INO were trying to lock the same extents, and interfering with each other? Signed-off-by: Zygo Blaxell --- include/crucible/extentwalker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/crucible/extentwalker.h b/include/crucible/extentwalker.h index b06a1da..1d93894 100644 --- a/include/crucible/extentwalker.h +++ b/include/crucible/extentwalker.h @@ -58,7 +58,7 @@ namespace crucible { virtual Vec get_extent_map(off_t pos); - static const unsigned sc_extent_fetch_max = 1024; + static const unsigned sc_extent_fetch_max = 16; static const unsigned sc_extent_fetch_min = 4; static const off_t sc_step_size = 0x1000 * (sc_extent_fetch_max / 2);