[lustre-devel] [PATCH 06/21] lustre: osc: Ensure there's no eviction with long cache discard

James Simmons jsimmons at infradead.org
Fri Feb 7 16:30:12 PST 2025


From: Oleg Drokin <green at whamcloud.com>

Just pause execution while doing page processing
for discard if appropriate failloc is set.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14711
Lustre-commit: c0a7f78529e21c9ca ("LU-14711 tests: Ensure there's no eviction with long cache discard")
Signed-off-by: Oleg Drokin <green at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/43869
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: James Nunez <jnunez at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/include/obd_support.h | 1 +
 fs/lustre/osc/osc_cache.c       | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/fs/lustre/include/obd_support.h b/fs/lustre/include/obd_support.h
index bd5ccea30b2a..f1e2e3bbb247 100644
--- a/fs/lustre/include/obd_support.h
+++ b/fs/lustre/include/obd_support.h
@@ -336,6 +336,7 @@ extern char obd_jobid_var[];
 #define OBD_FAIL_OSC_DELAY_IO				0x414
 #define OBD_FAIL_OSC_NO_SIZE_DATA			0x415
 #define OBD_FAIL_OSC_DELAY_CANCEL			0x416
+#define OBD_FAIL_OSC_SLOW_PAGE_EVICT			0x417
 
 #define OBD_FAIL_PTLRPC					0x500
 #define OBD_FAIL_PTLRPC_ACK				0x501
diff --git a/fs/lustre/osc/osc_cache.c b/fs/lustre/osc/osc_cache.c
index f1f21c28765e..37624a7a99d6 100644
--- a/fs/lustre/osc/osc_cache.c
+++ b/fs/lustre/osc/osc_cache.c
@@ -3196,6 +3196,9 @@ bool osc_page_gang_lookup(const struct lu_env *env, struct cl_io *io,
 		if (!res)
 			break;
 
+		OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_SLOW_PAGE_EVICT,
+				 cfs_fail_val ?: 20);
+
 		if (io->ci_type == CIT_MISC &&
 		    io->u.ci_misc.lm_next_rpc_time &&
 		    ktime_get_seconds() > io->u.ci_misc.lm_next_rpc_time) {
-- 
2.39.3



More information about the lustre-devel mailing list