Whamcloud - gitweb
LU-718 mdt: allow mds_num_threads module parameter
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 27 Aug 2012 21:19:40 +0000 (15:19 -0600)
committerOleg Drokin <green@whamcloud.com>
Wed, 24 Oct 2012 15:56:00 +0000 (11:56 -0400)
In 1.8.x the MDS service threads tunable is called "mds_num_threads",
but in 2.0/2.1 this was renamed mdt_num_threads without any chance
of compatibility.  In 2.3.x this was named back to mds_num_threads
(commit bd8835cc2dde6e86701650ccf90423ecd8fb042e) since the threads
are a property of the MDS, not of the MDT(s) on the system.

Add a compatible module option "mds_num_threads" for 2.1 so that it
is possible to upgrade 1.8->2.1->2.4 without problems.  No message
is printed in 2.1.x about deprecation, since it isn't possible to use
only one or the other in 2.1, and a warning will be printed in 2.3+
once the system is upgraded.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I3cb095812488b9459e4a3e878757d40410accab0
Reviewed-on: http://review.whamcloud.com/3804
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
lustre/mdt/mdt_handler.c

index 80bb811..1d80e50 100644 (file)
@@ -102,7 +102,14 @@ ldlm_mode_t mdt_dlm_lock_modes[] = {
 /*
  * Initialized in mdt_mod_init().
  */
+static unsigned long mds_num_threads;
+CFS_MODULE_PARM(mds_num_threads, "ul", ulong, 0444,
+                "number of MDS service threads to start (preferred)");
+
 static unsigned long mdt_num_threads;
+CFS_MODULE_PARM(mdt_num_threads, "ul", ulong, 0444,
+                "number of MDS service threads to start (deprecated)");
+
 static unsigned long mdt_min_threads;
 static unsigned long mdt_max_threads;
 
@@ -5844,6 +5851,14 @@ static int __init mdt_mod_init(void)
 
         llo_local_obj_register(&mdt_last_recv);
 
+        /* Compatibility with 1.8- and 2.3+.  It was a mistake to use
+         * mdt_num_threads, since the service threads relate to the MDS
+         * service, and not to the MDT(s).  Don't print a warning for
+         * now, to allow either one to work without annoyance.  There
+         * is a deprecation warning printed for mdt_num_threads in 2.3. */
+        if (mds_num_threads > 0 && mdt_num_threads == 0)
+                mdt_num_threads = mds_num_threads;
+
         if (mdt_num_threads > 0) {
                 if (mdt_num_threads > MDT_MAX_THREADS)
                         mdt_num_threads = MDT_MAX_THREADS;
@@ -6093,7 +6108,4 @@ MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
 MODULE_DESCRIPTION("Lustre Meta-data Target ("LUSTRE_MDT_NAME")");
 MODULE_LICENSE("GPL");
 
-CFS_MODULE_PARM(mdt_num_threads, "ul", ulong, 0444,
-                "number of mdt service threads to start");
-
 cfs_module(mdt, "0.2.0", mdt_mod_init, mdt_mod_exit);