Whamcloud - gitweb
LU-56 ptlrpc: partitioned ptlrpc service
[fs/lustre-release.git] / lustre / mdt / mdt_handler.c
index 97d3bed..f25a5e1 100644 (file)
@@ -97,6 +97,29 @@ ldlm_mode_t mdt_dlm_lock_modes[] = {
  * Initialized in mdt_mod_init().
  */
 static unsigned long mdt_num_threads;
+CFS_MODULE_PARM(mdt_num_threads, "ul", ulong, 0444,
+               "number of mdt service threads to start");
+
+static char *mdt_cpts;
+CFS_MODULE_PARM(mdt_cpts, "c", charp, 0444,
+               "CPU partitions MDT threads should run on");
+
+static unsigned long mdt_rdpg_num_threads;
+CFS_MODULE_PARM(mdt_rdpg_num_threads, "ul", ulong, 0444,
+               "number of mdt readpage service threads to start");
+
+static char *mdt_rdpg_cpts;
+CFS_MODULE_PARM(mdt_rdpg_cpts, "c", charp, 0444,
+               "CPU partitions MDT readpage threads should run on");
+
+/* NB: these two should be removed along with setattr service in the future */
+static unsigned long mdt_attr_num_threads;
+CFS_MODULE_PARM(mdt_attr_num_threads, "ul", ulong, 0444,
+               "number of mdt setattr service threads to start");
+
+static char *mdt_attr_cpts;
+CFS_MODULE_PARM(mdt_attr_cpts, "c", charp, 0444,
+               "CPU partitions MDT setattr threads should run on");
 
 /* ptlrpc request handler for MDT. All handlers are
  * grouped into several slices - struct mdt_opc_slice,
@@ -3954,11 +3977,17 @@ static int mdt_start_ptlrpc_service(struct mdt_device *m)
                 */
                .psc_thr                = {
                        .tc_thr_name            = LUSTRE_MDT_NAME,
-                       .tc_nthrs_min           = MDT_MIN_THREADS,
-                       .tc_nthrs_max           = MDT_MAX_THREADS,
+                       .tc_thr_factor          = MDT_THR_FACTOR,
+                       .tc_nthrs_init          = MDT_NTHRS_INIT,
+                       .tc_nthrs_base          = MDT_NTHRS_BASE,
+                       .tc_nthrs_max           = MDT_NTHRS_MAX,
                        .tc_nthrs_user          = mdt_num_threads,
+                       .tc_cpu_affinity        = 1,
                        .tc_ctx_tags            = LCT_MD_THREAD,
                },
+               .psc_cpt                = {
+                       .cc_pattern             = mdt_cpts,
+               },
                .psc_ops                = {
                        .so_req_handler         = mdt_regular_handle,
                        .so_req_printer         = target_print_req,
@@ -3991,11 +4020,17 @@ static int mdt_start_ptlrpc_service(struct mdt_device *m)
                },
                .psc_thr                = {
                        .tc_thr_name            = "mdt_rdpg",
-                       .tc_nthrs_min           = MDT_MIN_THREADS,
-                       .tc_nthrs_max           = MDT_MAX_THREADS,
-                       .tc_nthrs_user          = mdt_num_threads,
+                       .tc_thr_factor          = MDT_RDPG_THR_FACTOR,
+                       .tc_nthrs_init          = MDT_RDPG_NTHRS_INIT,
+                       .tc_nthrs_base          = MDT_RDPG_NTHRS_BASE,
+                       .tc_nthrs_max           = MDT_RDPG_NTHRS_MAX,
+                       .tc_nthrs_user          = mdt_rdpg_num_threads,
+                       .tc_cpu_affinity        = 1,
                        .tc_ctx_tags            = LCT_MD_THREAD,
                },
+               .psc_cpt                = {
+                       .cc_pattern             = mdt_rdpg_cpts,
+               },
                .psc_ops                = {
                        .so_req_handler         = mdt_readpage_handle,
                        .so_req_printer         = target_print_req,
@@ -4031,11 +4066,17 @@ static int mdt_start_ptlrpc_service(struct mdt_device *m)
                },
                .psc_thr                = {
                        .tc_thr_name            = "mdt_attr",
-                       .tc_nthrs_min           = MDT_MIN_THREADS,
-                       .tc_nthrs_max           = MDT_MAX_THREADS,
-                       .tc_nthrs_user          = mdt_num_threads,
+                       .tc_thr_factor          = MDT_SETA_THR_FACTOR,
+                       .tc_nthrs_init          = MDT_SETA_NTHRS_INIT,
+                       .tc_nthrs_base          = MDT_SETA_NTHRS_BASE,
+                       .tc_nthrs_max           = MDT_SETA_NTHRS_MAX,
+                       .tc_nthrs_user          = mdt_attr_num_threads,
+                       .tc_cpu_affinity        = 1,
                        .tc_ctx_tags            = LCT_MD_THREAD,
                },
+               .psc_cpt                = {
+                       .cc_pattern             = mdt_attr_cpts,
+               },
                .psc_ops                = {
                        .so_req_handler         = mdt_regular_handle,
                        .so_req_printer         = target_print_req,
@@ -4067,9 +4108,8 @@ static int mdt_start_ptlrpc_service(struct mdt_device *m)
                },
                .psc_thr                = {
                        .tc_thr_name            = "mdt_mdsc",
-                       .tc_nthrs_min           = MDT_MIN_THREADS,
-                       .tc_nthrs_max           = MDT_MAX_THREADS,
-                       .tc_nthrs_user          = mdt_num_threads,
+                       .tc_nthrs_init          = MDT_OTHR_NTHRS_INIT,
+                       .tc_nthrs_max           = MDT_OTHR_NTHRS_MAX,
                        .tc_ctx_tags            = LCT_MD_THREAD,
                },
                .psc_ops                = {
@@ -4103,9 +4143,8 @@ static int mdt_start_ptlrpc_service(struct mdt_device *m)
                },
                .psc_thr                = {
                        .tc_thr_name            = "mdt_mdss",
-                       .tc_nthrs_min           = MDT_MIN_THREADS,
-                       .tc_nthrs_max           = MDT_MAX_THREADS,
-                       .tc_nthrs_user          = mdt_num_threads,
+                       .tc_nthrs_init          = MDT_OTHR_NTHRS_INIT,
+                       .tc_nthrs_max           = MDT_OTHR_NTHRS_MAX,
                        .tc_ctx_tags            = LCT_MD_THREAD | LCT_DT_THREAD
                },
                .psc_ops                = {
@@ -4141,9 +4180,8 @@ static int mdt_start_ptlrpc_service(struct mdt_device *m)
                },
                .psc_thr                = {
                        .tc_thr_name            = "mdt_dtss",
-                       .tc_nthrs_min           = MDT_MIN_THREADS,
-                       .tc_nthrs_max           = MDT_MAX_THREADS,
-                       .tc_nthrs_user          = mdt_num_threads,
+                       .tc_nthrs_init          = MDT_OTHR_NTHRS_INIT,
+                       .tc_nthrs_max           = MDT_OTHR_NTHRS_MAX,
                        .tc_ctx_tags            = LCT_MD_THREAD | LCT_DT_THREAD
                },
                .psc_ops                = {
@@ -4175,9 +4213,8 @@ static int mdt_start_ptlrpc_service(struct mdt_device *m)
                },
                .psc_thr                = {
                        .tc_thr_name            = "mdt_fld",
-                       .tc_nthrs_min           = MDT_MIN_THREADS,
-                       .tc_nthrs_max           = MDT_MAX_THREADS,
-                       .tc_nthrs_user          = mdt_num_threads,
+                       .tc_nthrs_init          = MDT_OTHR_NTHRS_INIT,
+                       .tc_nthrs_max           = MDT_OTHR_NTHRS_MAX,
                        .tc_ctx_tags            = LCT_DT_THREAD | LCT_MD_THREAD
                },
                .psc_ops                = {
@@ -4212,9 +4249,8 @@ static int mdt_start_ptlrpc_service(struct mdt_device *m)
                },
                .psc_thr                = {
                        .tc_thr_name            = "mdt_mds",
-                       .tc_nthrs_min           = MDT_MIN_THREADS,
-                       .tc_nthrs_max           = MDT_MAX_THREADS,
-                       .tc_nthrs_user          = mdt_num_threads,
+                       .tc_nthrs_init          = MDT_OTHR_NTHRS_INIT,
+                       .tc_nthrs_max           = MDT_OTHR_NTHRS_MAX,
                        .tc_ctx_tags            = LCT_MD_THREAD,
                },
                .psc_ops                = {
@@ -5380,7 +5416,7 @@ static int mdt_init_export(struct obd_export *exp)
 err_free:
        lut_client_free(exp);
 err:
-       CERROR("%s: Error %d while initializing export\n",
+       CERROR("%s: Failed to initialize export: rc = %d\n",
               exp->exp_obd->obd_name, rc);
        return rc;
 }
@@ -6180,7 +6216,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);