From bbe7cc2888e9f509dab216e8340eca9ded43b77b Mon Sep 17 00:00:00 2001 From: myoungwon oh Date: Mon, 18 Mar 2024 06:48:07 +0000 Subject: [PATCH] crimson/os/seastore: cache metadata during trimming to prevent from disk read I encountered continous disk reads during trimming even though there are sufficient cache available, in 4K random write test with RBM (RBD). This is because metadata is note cached if its source is background transaction within touch_extent(). So, seastore, including the trimming process, needs to constantly retrieve metadata (e.g., BACKREF_LEAF). Signed-off-by: Myoungwon Oh (cherry picked from commit 7f253ce5aa98018b5b209fd6e062078d151ad567) --- src/crimson/os/seastore/cache.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/crimson/os/seastore/cache.h b/src/crimson/os/seastore/cache.h index 75463f465fe1..829d57da1931 100644 --- a/src/crimson/os/seastore/cache.h +++ b/src/crimson/os/seastore/cache.h @@ -1342,8 +1342,11 @@ public: CachedExtent &ext, const Transaction::src_t* p_src=nullptr) { - if (p_src && is_background_transaction(*p_src)) + if (p_src && + is_background_transaction(*p_src) && + is_logical_type(ext.get_type())) { return; + } if (ext.is_stable_clean() && !ext.is_placeholder()) { lru.move_to_top(ext); } -- 2.47.3