Whamcloud - gitweb
Branch b1_4
authoradilger <adilger>
Mon, 16 May 2005 18:22:42 +0000 (18:22 +0000)
committeradilger <adilger>
Mon, 16 May 2005 18:22:42 +0000 (18:22 +0000)
Decrease the ldlm_timeout if obd_timeout is dropped.  It doesn't really make
sense to have AST timeouts longer than the RPC timeouts, but is mostly only
noticable in our regression tests (recovery-small.sh test 10 in particular).
b=6172

lustre/obdclass/genops.c
lustre/obdclass/obd_config.c
lustre/obdclass/sysctl.c

index a93256d..4908339 100644 (file)
@@ -65,8 +65,7 @@ static struct obd_type *class_search_type(char *name)
         spin_lock(&obd_types_lock);
         list_for_each(tmp, &obd_types) {
                 type = list_entry(tmp, struct obd_type, typ_chain);
-                if (strlen(type->typ_name) == strlen(name) &&
-                    strcmp(type->typ_name, name) == 0) {
+                if (strcmp(type->typ_name, name) == 0) {
                         spin_unlock(&obd_types_lock);
                         return type;
                 }
index 91535d7..6c4b758 100644 (file)
@@ -606,6 +606,10 @@ int class_process_config(struct lustre_cfg *lcfg)
                 CDEBUG(D_IOCTL, "changing lustre timeout from %d to %d\n",
                        obd_timeout, lcfg->lcfg_num);
                 obd_timeout = max(lcfg->lcfg_num, 1U);
+                if (ldlm_timeout >= obd_timeout)
+                        ldlm_timeout = max(obd_timeout / 3, 1U);
+                else if (ldlm_timeout < 10 && obd_timeout >= ldlm_timeout * 4)
+                        ldlm_timeout = min(obd_timeout / 3, 30U);
                 GOTO(out, err = 0);
         }
         case LCFG_SET_UPCALL: {
index e4704f2..1bf8a27 100644 (file)
@@ -58,31 +58,47 @@ enum {
 };
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
-int proc_fail_loc(ctl_table *table, int write, struct file *filp,
-                  void *buffer, size_t *lenp)
+#define ll_proc_dointvec(table,write,filp,buffer,lenp,ppos)             \
+        proc_dointvec(table,write,filp,buffer,lenp)
+#define LL_PROC_PROTO(name)                                             \
+        name(ctl_table *table, int write, struct file *filp,   \
+                      void *buffer, size_t *lenp)
 #else
-int proc_fail_loc(ctl_table *table, int write, struct file *filp,
+#define ll_proc_dointvec(table,write,filp,buffer,lenp,ppos)             \
+        proc_dointvec(table,write,filp,buffer,lenp,ppos);
+#define LL_PROC_PROTO(name)                                             \
+        name(ctl_table *table, int write, struct file *filp,            \
                   void *buffer, size_t *lenp, loff_t *ppos)
 #endif
+
+int LL_PROC_PROTO(proc_fail_loc)
 {
         int rc;
         int old_fail_loc = obd_fail_loc;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
-        rc = proc_dointvec(table,write,filp,buffer,lenp);
-#else
-        rc = proc_dointvec(table,write,filp,buffer,lenp,ppos);
-#endif
+        rc = ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
         if (old_fail_loc != obd_fail_loc)
                 wake_up(&obd_race_waitq);
         return rc;
 }
 
+int LL_PROC_PROTO(proc_set_timeout)
+{
+        int rc;
+
+        rc = ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
+        if (ldlm_timeout >= obd_timeout)
+                ldlm_timeout = max(obd_timeout / 3, 1U);
+        else if (ldlm_timeout < 10 && obd_timeout >= ldlm_timeout * 4)
+                ldlm_timeout = min(obd_timeout / 3, 30U);
+        return rc;
+}
+
 static ctl_table obd_table[] = {
         {OBD_FAIL_LOC, "fail_loc", &obd_fail_loc, sizeof(int), 0644, NULL,
-                &proc_dointvec},
-        {OBD_TIMEOUT, "timeout", &obd_timeout, sizeof(int), 0644, NULL,
                 &proc_fail_loc},
+        {OBD_TIMEOUT, "timeout", &obd_timeout, sizeof(int), 0644, NULL,
+                &proc_set_timeout},
         {OBD_DUMP_ON_TIMEOUT, "dump_on_timeout", &obd_dump_on_timeout,
                 sizeof(int), 0644, NULL, &proc_dointvec},
         /* XXX need to lock so we avoid update races with recovery upcall! */
@@ -93,7 +109,7 @@ static ctl_table obd_table[] = {
         {OBD_SYNCFILTER, "filter_sync_on_commit", &obd_sync_filter, sizeof(int),
                 0644, NULL, &proc_dointvec},
         {OBD_LDLM_TIMEOUT, "ldlm_timeout", &ldlm_timeout, sizeof(int), 0644,
-                NULL, &proc_dointvec},
+                NULL, &proc_set_timeout},
         { 0 }
 };