Whamcloud - gitweb
Branch b1_8
authorjohann <johann>
Tue, 3 Nov 2009 13:38:53 +0000 (13:38 +0000)
committerjohann <johann>
Tue, 3 Nov 2009 13:38:53 +0000 (13:38 +0000)
b=20978
i=nathan
i=panda

Replace the global MGC lock with a per-config_llog_data semaphore.

lustre/ChangeLog
lustre/include/obd_class.h
lustre/mgc/mgc_request.c

index e2043c1..7015c62 100644 (file)
@@ -13,7 +13,7 @@ tbd Sun Microsystems, Inc.
 Severity   : enhancement
 Bugzilla   : 19325
 Description: Adjust locks' extents on their first enqueue, so that at the time
-             they get granted, there is no need for another pass through the
+            they get granted, there is no need for another pass through the
             queues since they are already shaped into the proper forms.
 
 Severity   : normal
@@ -24,11 +24,11 @@ Description: Fix mds_shrink_intent_reply()/mds_intent_policy() to pass correct
 Severity   : normal
 Bugzilla   : 19689
 Description: Change tunefs.lustre and mkfs.lustre --mountfsoptions so that
-             exactly the specified mount options are used.  Leaving off
-             any "mandatory" mount options is an error.  Leaving off any
-             default mount options causes a warning, but is allowed.
-             Change errors=remount-ro from mandatory to default.  Sanitize
-             the mount string before storing it.  Update man pages accordingly.
+            exactly the specified mount options are used.  Leaving off
+            any "mandatory" mount options is an error.  Leaving off any
+            default mount options causes a warning, but is allowed.
+            Change errors=remount-ro from mandatory to default.  Sanitize
+            the mount string before storing it.  Update man pages accordingly.
 
 Severity   : normal
 Bugzilla   : 20302
@@ -51,7 +51,7 @@ Description: Conf-sanity.sh test to check client reconnection to a busy server.
 Severity   : enhancement
 Bugzilla   : 16312
 Description: Build kernels (RHEL5, OEL5 and SLES10/11) using the vendor's own
-             kernel spec file.
+            kernel spec file.
 
 Severity   : normal
 Bugzilla   : 16774
@@ -199,6 +199,12 @@ Description: quotacheck performance/scaling issues
 Details    : reduce quotacheck time on empty filesystem by skipping uninit
             group.
 
+Severity   : normal
+Bugzilla   : 20978
+Description: Slow stale export processing during normal start up
+Details    : The global mgc lock prevents OST setup to be run in parallel.
+            Replace the global lock with a per-config_llog_data semaphore.
+
 -------------------------------------------------------------------------------
 2009-10-16 Sun Microsystems, Inc.
        * version 1.8.1.1
index 18358e5..92c4cde 100644 (file)
@@ -154,6 +154,7 @@ struct config_llog_data {
         struct obd_export  *cld_mgcexp;
         unsigned int        cld_stopping:1; /* we were told to stop watching */
         unsigned int        cld_lostlock:1; /* lock not requeued */
+        struct semaphore    cld_sem; /* for exclusive processing of the log */
 };
 
 struct lustre_profile {
index 680a1d5..11288b8 100644 (file)
@@ -210,6 +210,7 @@ static int config_log_add(char *logname, struct config_llog_instance *cfg,
         cld->cld_cfg.cfg_flags = 0;
         cld->cld_cfg.cfg_sb = sb;
         atomic_set(&cld->cld_refcount, 1);
+        init_mutex(&cld->cld_sem);
 
         /* Keep the mgc around until we are done */
         cld->cld_mgcexp = class_export_get(lsi->lsi_mgc->obd_self_export);
@@ -232,8 +233,6 @@ static int config_log_add(char *logname, struct config_llog_instance *cfg,
         RETURN(rc);
 }
 
-DECLARE_MUTEX(llog_process_lock);
-
 /* Stop watching for updates on this log. */
 static int config_log_end(char *logname, struct config_llog_instance *cfg)
 {
@@ -247,9 +246,9 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
         /* drop the ref from the find */
         config_log_put(cld);
 
-        down(&llog_process_lock);
+        down(&cld->cld_sem);
         cld->cld_stopping = 1;
-        up(&llog_process_lock);
+        up(&cld->cld_sem);
 
         /* drop the start ref */
         config_log_put(cld);
@@ -1111,14 +1110,10 @@ static int mgc_process_log(struct obd_device *mgc,
                 RETURN(-EINVAL);
         }
 
-        /* I don't want mutliple processes running process_log at once --
-           sounds like badness.  It actually might be fine, as long as
-           we're not trying to update from the same log
-           simultaneously (in which case we should use a per-log sem.) */
-        down(&llog_process_lock);
-
+        /* Serialize update from the same log */
+        down(&cld->cld_sem);
         if (cld->cld_stopping) {
-                up(&llog_process_lock);
+                up(&cld->cld_sem);
                 RETURN(0);
         }
 
@@ -1131,8 +1126,8 @@ static int mgc_process_log(struct obd_device *mgc,
 
         ctxt = llog_get_context(mgc, LLOG_CONFIG_REPL_CTXT);
         if (!ctxt) {
+                up(&cld->cld_sem);
                 CERROR("missing llog context\n");
-                up(&llog_process_lock);
                 RETURN(-EINVAL);
         }
 
@@ -1192,12 +1187,11 @@ out_pop:
                 if (rcl)
                         CERROR("Can't drop cfg lock: %d\n", rcl);
         }
+        up(&cld->cld_sem);
 
         CDEBUG(D_MGC, "%s: configuration from log '%s' %sed (%d).\n",
                mgc->obd_name, cld->cld_logname, rc ? "fail" : "succeed", rc);
 
-        up(&llog_process_lock);
-
         RETURN(rc);
 }