From 61b90c37deb75e918f044dc2c129d7c858b005a5 Mon Sep 17 00:00:00 2001 From: nikita <nikita> Date: Sat, 18 Oct 2008 15:27:57 +0000 Subject: [PATCH] Add two new failloc constants to test lockless IO. Only one of them in implemented---another is checked in yet to be landed core CLIO code. b=16450 --- lustre/ChangeLog | 7 +++++++ lustre/include/obd_support.h | 4 ++++ lustre/ldlm/ldlm_extent.c | 3 +++ 3 files changed, 14 insertions(+) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 04c24027e4..8afb64c976 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -1471,6 +1471,13 @@ Details : Augment ->do_{read,write}_lock() prototypes with a `role' parameter indicating lock ordering. Update mdd code to use new locking interface. +Severity : normal +Bugzilla : 16450 +Description: Introduce failloc constants for lockless IO tests. +Details : Add two new failloc constants to test lockless IO. Only one of + them in implemented---another is checked in yet to be landed + core CLIO code. + -------------------------------------------------------------------------------- 2007-08-10 Cluster File Systems, Inc. <info@clusterfs.com> diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index 7b5d777f72..78481ceb90 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -254,6 +254,9 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, #define OBD_FAIL_LDLM_CANCEL_BL_CB_RACE 0x314 #define OBD_FAIL_LDLM_CP_CB_WAIT 0x315 +/* LOCKLESS IO */ +#define OBD_FAIL_LDLM_SET_CONTENTION 0x315 + #define OBD_FAIL_OSC 0x400 #define OBD_FAIL_OSC_BRW_READ_BULK 0x401 #define OBD_FAIL_OSC_BRW_WRITE_BULK 0x402 @@ -268,6 +271,7 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, #define OBD_FAIL_OSC_CONNECT_CKSUM 0x40b #define OBD_FAIL_OSC_CKSUM_ADLER_ONLY 0x40c #define OBD_FAIL_OSC_DIO_PAUSE 0x40d +#define OBD_FAIL_OSC_OBJECT_CONTENTION 0x40e #define OBD_FAIL_PTLRPC 0x500 #define OBD_FAIL_PTLRPC_ACK 0x501 diff --git a/lustre/ldlm/ldlm_extent.c b/lustre/ldlm/ldlm_extent.c index 689f0a2bc1..3b6543e1b8 100644 --- a/lustre/ldlm/ldlm_extent.c +++ b/lustre/ldlm/ldlm_extent.c @@ -284,6 +284,9 @@ static int ldlm_check_contention(struct ldlm_lock *lock, int contended_locks) struct ldlm_resource *res = lock->l_resource; cfs_time_t now = cfs_time_current(); + if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_SET_CONTENTION)) + return 1; + CDEBUG(D_DLMTRACE, "contended locks = %d\n", contended_locks); if (contended_locks > res->lr_namespace->ns_contended_locks) res->lr_contention_time = now; -- GitLab