Whamcloud - gitweb
Branch HEAD
authortianzy <tianzy>
Tue, 24 Feb 2009 07:43:59 +0000 (07:43 +0000)
committertianzy <tianzy>
Tue, 24 Feb 2009 07:43:59 +0000 (07:43 +0000)
add more debug info for AT and fix a minor error in replay-single.sh
b=18426
i=nathan

lustre/ldlm/ldlm_lockd.c
lustre/ptlrpc/import.c
lustre/tests/replay-single.sh

index 58875a9..ae31ec6 100644 (file)
@@ -413,6 +413,7 @@ static int __ldlm_add_waiting_lock(struct ldlm_lock *lock, int seconds)
 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));
 
@@ -428,15 +429,16 @@ static int ldlm_add_waiting_lock(struct ldlm_lock *lock)
                 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;
 }
 
index 65eedd1..cb0e2e6 100644 (file)
@@ -1440,11 +1440,10 @@ int at_add(struct adaptive_timeout *at, unsigned int val)
         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 */
@@ -1496,14 +1495,12 @@ int at_add(struct adaptive_timeout *at, unsigned int val)
                 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;
index f7906bc..46bf4e7 100755 (executable)
@@ -1762,8 +1762,13 @@ test_68 () #bug 13813
     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
@@ -1774,7 +1779,9 @@ test_68 () #bug 13813
     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"