@@ -708,12 +708,6 @@ struct ldlm_lock {
wait_queue_head_t l_waitq;
/**
- * Seconds. It will be updated if there is any activity related to
- * the lock, e.g. enqueue the lock or send blocking AST.
- */
- time64_t l_last_activity;
-
- /**
* Time, in nanoseconds, last used by e.g. being matched by lock match.
*/
ktime_t l_last_used;
@@ -735,6 +729,13 @@ struct ldlm_lock {
/** Private storage for lock user. Opaque to LDLM. */
void *l_ast_data;
+
+ /**
+ * Seconds. It will be updated if there is any activity related to
+ * the lock at client, e.g. enqueue the lock.
+ */
+ time64_t l_activity;
+
/* Separate ost_lvb used mostly by Data-on-MDT for now.
* It is introduced to don't mix with layout lock data.
*/
@@ -420,6 +420,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)
lu_ref_init(&lock->l_reference);
lu_ref_add(&lock->l_reference, "hash", lock);
lock->l_callback_timeout = 0;
+ lock->l_activity = 0;
#if LUSTRE_TRACKS_LOCK_EXP_REFS
INIT_LIST_HEAD(&lock->l_exp_refs_link);
@@ -114,9 +114,9 @@ static void ldlm_expired_completion_wait(struct ldlm_lock *lock, u32 conn_cnt)
LDLM_ERROR(lock,
"lock timed out (enqueued at %lld, %llds ago); not entering recovery in server code, just going back to sleep",
- (s64)lock->l_last_activity,
+ (s64)lock->l_activity,
(s64)(ktime_get_real_seconds() -
- lock->l_last_activity));
+ lock->l_activity));
if (ktime_get_seconds() > next_dump) {
last_dump = next_dump;
next_dump = ktime_get_seconds() + 300;
@@ -133,8 +133,8 @@ static void ldlm_expired_completion_wait(struct ldlm_lock *lock, u32 conn_cnt)
ptlrpc_fail_import(imp, conn_cnt);
LDLM_ERROR(lock,
"lock timed out (enqueued at %lld, %llds ago), entering recovery for %s@%s",
- (s64)lock->l_last_activity,
- (s64)(ktime_get_real_seconds() - lock->l_last_activity),
+ (s64)lock->l_activity,
+ (s64)(ktime_get_real_seconds() - lock->l_activity),
obd2cli_tgt(obd), imp->imp_connection->c_remote_uuid.uuid);
}
@@ -182,7 +182,7 @@ static int ldlm_completion_tail(struct ldlm_lock *lock, void *data)
LDLM_DEBUG(lock, "client-side enqueue: granted");
} else {
/* Take into AT only CP RPC, not immediately granted locks */
- delay = ktime_get_real_seconds() - lock->l_last_activity;
+ delay = ktime_get_real_seconds() - lock->l_activity;
LDLM_DEBUG(lock, "client-side enqueue: granted after %lds",
delay);
@@ -245,7 +245,7 @@ int ldlm_completion_ast(struct ldlm_lock *lock, u64 flags, void *data)
timeout = ldlm_cp_timeout(lock);
- lock->l_last_activity = ktime_get_real_seconds();
+ lock->l_activity = ktime_get_real_seconds();
if (imp) {
spin_lock(&imp->imp_lock);
@@ -725,7 +725,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
lock->l_export = NULL;
lock->l_blocking_ast = einfo->ei_cb_bl;
lock->l_flags |= (*flags & (LDLM_FL_NO_LRU | LDLM_FL_EXCL));
- lock->l_last_activity = ktime_get_real_seconds();
+ lock->l_activity = ktime_get_real_seconds();
/* lock not sent to server yet */
if (!reqp || !*reqp) {