Whamcloud - gitweb
Branch b1_8
authortianzy <tianzy>
Tue, 21 Apr 2009 09:40:11 +0000 (09:40 +0000)
committertianzy <tianzy>
Tue, 21 Apr 2009 09:40:11 +0000 (09:40 +0000)
1. delete the lc_watchdog_touch_ms()
2. changing to seconds instead of ms
3. delete lcw_time in lc_watchdog
b=18582
i=nathan
i=johann

lustre/include/lustre_net.h
lustre/ldlm/ldlm_lockd.c
lustre/mds/handler.c
lustre/mds/mds_internal.h
lustre/mgs/mgs_handler.c
lustre/ost/ost_internal.h
lustre/ptlrpc/service.c
lustre/quota/quota_context.c
lustre/quota/quota_interface.c

index 6a6db15..de90bd1 100644 (file)
@@ -559,6 +559,8 @@ struct ptlrpc_thread {
         unsigned int t_id; /* service thread index, from ptlrpc_start_threads */
         struct lc_watchdog *t_watchdog; /* put watchdog in the structure per
                                          * thread b=14840 */
+        struct ptlrpc_service *t_svc;   /* the svc this thread belonged to
+                                         * b=18582 */
         cfs_waitq_t t_ctl_waitq;
 };
 
index 28d5823..3c06d8f 100644 (file)
@@ -2139,7 +2139,7 @@ static int ldlm_setup(void)
         ldlm_state->ldlm_cb_service =
                 ptlrpc_init_svc(LDLM_NBUFS, LDLM_BUFSIZE, LDLM_MAXREQSIZE,
                                 LDLM_MAXREPSIZE, LDLM_CB_REQUEST_PORTAL,
-                                LDLM_CB_REPLY_PORTAL, 1800,
+                                LDLM_CB_REPLY_PORTAL, 2,
                                 ldlm_callback_handler, "ldlm_cbd",
                                 ldlm_svc_proc_dir, NULL,
                                 ldlm_min_threads, ldlm_max_threads,
@@ -2153,7 +2153,7 @@ static int ldlm_setup(void)
         ldlm_state->ldlm_cancel_service =
                 ptlrpc_init_svc(LDLM_NBUFS, LDLM_BUFSIZE, LDLM_MAXREQSIZE,
                                 LDLM_MAXREPSIZE, LDLM_CANCEL_REQUEST_PORTAL,
-                                LDLM_CANCEL_REPLY_PORTAL, 6000,
+                                LDLM_CANCEL_REPLY_PORTAL, 6,
                                 ldlm_cancel_handler, "ldlm_canceld",
                                 ldlm_svc_proc_dir, NULL,
                                 ldlm_min_threads, ldlm_max_threads,
index c275774..a5006b9 100644 (file)
@@ -1162,7 +1162,7 @@ static int mds_statfs(struct ptlrpc_request *req)
         /* This will trigger a watchdog timeout */
         OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_STATFS_LCW_SLEEP,
                          (MDS_SERVICE_WATCHDOG_FACTOR *
-                          at_get(&svc->srv_at_estimate) / 1000) + 1);
+                          at_get(&svc->srv_at_estimate)) + 1);
         OBD_COUNTER_INCREMENT(obd, statfs);
 
         if (OBD_FAIL_CHECK(OBD_FAIL_MDS_STATFS_PACK))
index 3ce767c..3516d6f 100644 (file)
@@ -44,7 +44,7 @@
 #define MDT_INCOMPAT_SUPP       (OBD_INCOMPAT_MDT | OBD_INCOMPAT_COMMON_LR | \
                                  OBD_INCOMPAT_FID)
 
-#define MDS_SERVICE_WATCHDOG_FACTOR 2000
+#define MDS_SERVICE_WATCHDOG_FACTOR 2
 
 #define MAX_ATIME_DIFF 60
 
index 2718f52..a177dd3 100644 (file)
@@ -220,7 +220,7 @@ static int mgs_setup(struct obd_device *obd, obd_count len, void *buf)
         mgs->mgs_service =
                 ptlrpc_init_svc(MGS_NBUFS, MGS_BUFSIZE, MGS_MAXREQSIZE,
                                 MGS_MAXREPSIZE, MGS_REQUEST_PORTAL,
-                                MGC_REPLY_PORTAL, 2000,
+                                MGC_REPLY_PORTAL, 2,
                                 mgs_handle, LUSTRE_MGS_NAME,
                                 obd->obd_proc_entry, NULL,
                                 MGS_THREADS_AUTO_MIN, MGS_THREADS_AUTO_MAX,
index f0dc910..3cbb4fa 100644 (file)
@@ -37,7 +37,7 @@
 #ifndef OST_INTERNAL_H
 #define OST_INTERNAL_H
 
-#define OSS_SERVICE_WATCHDOG_FACTOR 2000
+#define OSS_SERVICE_WATCHDOG_FACTOR 2
 
 /*
  * tunables for per-thread page pool (bug 5137)
index 6ce3020..8631487 100644 (file)
@@ -1657,10 +1657,7 @@ static int ptlrpc_main(void *arg)
          */
         cfs_waitq_signal(&thread->t_ctl_waitq);
 
-        thread->t_watchdog = lc_watchdog_add(max_t(int, obd_timeout, AT_OFF ? 0 :
-                                                   at_get(&svc->srv_at_estimate))
-                                             *  svc->srv_watchdog_factor,
-                                             NULL, NULL);
+        thread->t_watchdog = lc_watchdog_add(GET_TIMEOUT(svc), NULL, NULL);
 
         spin_lock(&svc->srv_lock);
         svc->srv_threads_running++;
@@ -1696,10 +1693,7 @@ static int ptlrpc_main(void *arg)
                               svc->srv_at_check,
                               &lwi);
 
-                lc_watchdog_touch_ms(thread->t_watchdog, max_t(int, obd_timeout,
-                                     AT_OFF ? 0 :
-                                     at_get(&svc->srv_at_estimate)) *
-                                     svc->srv_watchdog_factor);
+                lc_watchdog_touch(thread->t_watchdog, GET_TIMEOUT(svc));
 
                 ptlrpc_check_rqbd_pool(svc);
 
@@ -1856,6 +1850,7 @@ int ptlrpc_start_thread(struct obd_device *dev, struct ptlrpc_service *svc)
         id = svc->srv_threads_started++;
         spin_unlock(&svc->srv_lock);
 
+        thread->t_svc = svc;
         thread->t_id = id;
         sprintf(name, "%s_%02d", svc->srv_thread_name, id);
         d.dev = dev;
index 52b0891..95e0c23 100644 (file)
@@ -928,7 +928,8 @@ schedule_dqacq(struct obd_device *obd, struct lustre_quota_ctxt *qctxt,
                         l_wait_event(qctxt->lqc_wait_for_qmaster,
                                      check_qm(qctxt), &lwi);
                         CDEBUG(D_QUOTA, "wake up when quota master is back\n");
-                        lc_watchdog_touch(oti->oti_thread->t_watchdog);
+                        lc_watchdog_touch(oti->oti_thread->t_watchdog,
+                                 GET_TIMEOUT(oti->oti_thread->t_svc));
                 } else {
                         spin_unlock(&qctxt->lqc_lock);
                 }
index c621c85..fb1dd26 100644 (file)
@@ -397,7 +397,8 @@ static int quota_chk_acq_common(struct obd_device *obd, unsigned int uid,
                         l_wait_event(qctxt->lqc_wait_for_qmaster, check_qm(qctxt),
                                      &lwi);
                         CDEBUG(D_QUOTA, "wake up when quota master is back\n");
-                        lc_watchdog_touch(oti->oti_thread->t_watchdog);
+                        lc_watchdog_touch(oti->oti_thread->t_watchdog,
+                                 GET_TIMEOUT(oti->oti_thread->t_svc));
                 } else {
                         spin_unlock(&qctxt->lqc_lock);
                 }
@@ -428,7 +429,8 @@ static int quota_chk_acq_common(struct obd_device *obd, unsigned int uid,
                         struct l_wait_info lwi;
 
                         if (oti && oti->oti_thread && oti->oti_thread->t_watchdog)
-                                lc_watchdog_touch(oti->oti_thread->t_watchdog);
+                                lc_watchdog_touch(oti->oti_thread->t_watchdog,
+                                         GET_TIMEOUT(oti->oti_thread->t_svc));
                         CDEBUG(D_QUOTA, "rc: %d, count_err: %d\n", rc,
                                count_err++);