From bd8835cc2dde6e86701650ccf90423ecd8fb042e Mon Sep 17 00:00:00 2001 From: wangdi Date: Wed, 11 Jul 2012 02:34:11 -0700 Subject: [PATCH] LU-718 mdt: rename mdt threads parameters to mds rename mdt threads parameters to mds, so the following mds layer change does not need to deal with the compatiblity issue. Signed-off-by: Wang Di Change-Id: I3cb095812488b9459e4a3e878757d40410ac4191 Reviewed-on: http://review.whamcloud.com/3377 Tested-by: Hudson Reviewed-by: Andreas Dilger Reviewed-by: Liang Zhen Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_handler.c | 56 +++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 64fcecf..9d9c84d 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -98,28 +98,33 @@ ldlm_mode_t mdt_dlm_lock_modes[] = { */ static unsigned long mdt_num_threads; CFS_MODULE_PARM(mdt_num_threads, "ul", ulong, 0444, - "number of mdt service threads to start"); + "number of MDS service threads to start " + "(deprecated in favor of mds_num_threads)"); -static char *mdt_cpts; -CFS_MODULE_PARM(mdt_cpts, "c", charp, 0444, - "CPU partitions MDT threads should run on"); +static unsigned long mds_num_threads; +CFS_MODULE_PARM(mds_num_threads, "ul", ulong, 0444, + "number of MDS service threads to start"); -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 *mds_num_cpts; +CFS_MODULE_PARM(mds_num_cpts, "c", charp, 0444, + "CPU partitions MDS threads should run on"); -static char *mdt_rdpg_cpts; -CFS_MODULE_PARM(mdt_rdpg_cpts, "c", charp, 0444, - "CPU partitions MDT readpage threads should run on"); +static unsigned long mds_rdpg_num_threads; +CFS_MODULE_PARM(mds_rdpg_num_threads, "ul", ulong, 0444, + "number of MDS readpage service threads to start"); + +static char *mds_rdpg_num_cpts; +CFS_MODULE_PARM(mds_rdpg_num_cpts, "c", charp, 0444, + "CPU partitions MDS 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 unsigned long mds_attr_num_threads; +CFS_MODULE_PARM(mds_attr_num_threads, "ul", ulong, 0444, + "number of MDS 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"); +static char *mds_attr_num_cpts; +CFS_MODULE_PARM(mds_attr_num_cpts, "c", charp, 0444, + "CPU partitions MDS setattr threads should run on"); /* ptlrpc request handler for MDT. All handlers are * grouped into several slices - struct mdt_opc_slice, @@ -3986,12 +3991,12 @@ static int mdt_start_ptlrpc_service(struct mdt_device *m) .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_nthrs_user = mds_num_threads, .tc_cpu_affinity = 1, .tc_ctx_tags = LCT_MD_THREAD, }, .psc_cpt = { - .cc_pattern = mdt_cpts, + .cc_pattern = mds_num_cpts, }, .psc_ops = { .so_req_handler = mdt_regular_handle, @@ -4030,12 +4035,12 @@ static int mdt_start_ptlrpc_service(struct mdt_device *m) .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_nthrs_user = mds_rdpg_num_threads, .tc_cpu_affinity = 1, .tc_ctx_tags = LCT_MD_THREAD, }, .psc_cpt = { - .cc_pattern = mdt_rdpg_cpts, + .cc_pattern = mds_rdpg_num_cpts, }, .psc_ops = { .so_req_handler = mdt_readpage_handle, @@ -4077,12 +4082,12 @@ static int mdt_start_ptlrpc_service(struct mdt_device *m) .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_nthrs_user = mds_attr_num_threads, .tc_cpu_affinity = 1, .tc_ctx_tags = LCT_MD_THREAD, }, .psc_cpt = { - .cc_pattern = mdt_attr_cpts, + .cc_pattern = mds_attr_num_cpts, }, .psc_ops = { .so_req_handler = mdt_regular_handle, @@ -6005,6 +6010,13 @@ static int __init mdt_mod_init(void) struct lprocfs_static_vars lvars; int rc; + if (mdt_num_threads != 0 && mds_num_threads == 0) { + LCONSOLE_INFO("mdt_num_threads module parameter is deprecated," + "use mds_num_threads instead or unset both for" + "dynamic thread startup\n"); + mds_num_threads = mdt_num_threads; + } + lprocfs_mdt_init_vars(&lvars); rc = class_register_type(&mdt_obd_device_ops, NULL, lvars.module_vars, LUSTRE_MDT_NAME, -- 1.8.3.1