diff mbox series

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

Message ID 20250208003027.180076-7-jsimmons@infradead.org (mailing list archive)
State New
Headers show
Series lustre: sync to OpenSFS branch June 28, 2023 | expand

Commit Message

James Simmons Feb. 8, 2025, 12:30 a.m. UTC
From: Oleg Drokin <green@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@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/43869
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/obd_support.h | 1 +
 fs/lustre/osc/osc_cache.c       | 3 +++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

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) {