static int ldlm_add_waiting_lock(struct ldlm_lock *lock)
{
int ret;
+ int timeout = ldlm_get_enq_timeout(lock);
LASSERT(!(lock->l_flags & LDLM_FL_CANCEL_ON_BLOCK));
return 0;
}
- ret = __ldlm_add_waiting_lock(lock, ldlm_get_enq_timeout(lock));
+ ret = __ldlm_add_waiting_lock(lock, timeout);
if (ret)
/* grab ref on the lock if it has been added to the
* waiting list */
LDLM_LOCK_GET(lock);
spin_unlock_bh(&waiting_locks_spinlock);
- LDLM_DEBUG(lock, "%sadding to wait list",
- ret == 0 ? "not re-" : "");
+ LDLM_DEBUG(lock, "%sadding to wait list(timeout: %d, AT: %s)",
+ ret == 0 ? "not re-" : "", timeout,
+ AT_OFF ? "off" : "on");
return ret;
}
time_t binlimit = max_t(time_t, at_history / AT_BINS, 1);
LASSERT(at);
-#if 0
- CDEBUG(D_INFO, "add %u to %p time=%lu v=%u (%u %u %u %u)\n",
+ CDEBUG(D_OTHER, "add %u to %p time=%lu v=%u (%u %u %u %u)\n",
val, at, now - at->at_binstart, at->at_current,
at->at_hist[0], at->at_hist[1], at->at_hist[2], at->at_hist[3]);
-#endif
+
if (val == 0)
/* 0's don't count, because we never want our timeout to
drop to 0, and because 0 could mean an error */
at->at_current = min(at->at_current, at_max);
at->at_current = max(at->at_current, at_min);
-#if 0
if (at->at_current != old)
- CDEBUG(D_ADAPTTO, "AT %p change: old=%u new=%u delta=%d "
+ CDEBUG(D_OTHER, "AT %p change: old=%u new=%u delta=%d "
"(val=%u) hist %u %u %u %u\n", at,
old, at->at_current, at->at_current - old, val,
at->at_hist[0], at->at_hist[1], at->at_hist[2],
at->at_hist[3]);
-#endif
/* if we changed, report the old value */
old = (at->at_current != old) ? old : 0;
at_start || return 0
local ldlm_enqueue_min=$(find /sys -name ldlm_enqueue_min)
[ -z "$ldlm_enqueue_min" ] && skip "missing /sys/.../ldlm_enqueue_min" && return 0
+ local ldlm_enqueue_min_r=$(do_facet ost1 "find /sys -name ldlm_enqueue_min")
+ [ -z "$ldlm_enqueue_min_r" ] && skip "missing /sys/.../ldlm_enqueue_min in the ost1" && return 0
local ENQ_MIN=$(cat $ldlm_enqueue_min)
+ local ENQ_MIN_R=$(do_facet ost1 "cat $ldlm_enqueue_min_r")
echo $TIMEOUT >> $ldlm_enqueue_min
+ do_facet ost1 "echo $TIMEOUT >> $ldlm_enqueue_min_r"
+
rm -f $DIR/${tfile}_[1-2]
lfs setstripe $DIR/$tfile --index=0 --count=1
#define OBD_FAIL_LDLM_PAUSE_CANCEL 0x312
sysctl -w lustre.fail_loc=0x80000312
cp /etc/profile $DIR/${tfile}_2 || error "2nd cp failed $?"
sysctl -w lustre.fail_loc=0
+
echo $ENQ_MIN >> $ldlm_enqueue_min
+ do_facet ost1 "echo $ENQ_MIN_R >> $ldlm_enqueue_min_r"
return 0
}
run_test 68 "AT: verify slowing locks"