From 02ef72cbe43b8817644cbbc3fab812c6192f16a8 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Mon, 25 Nov 2013 17:53:40 +0400 Subject: [PATCH] LU-3467 target: use osc_reply_portal for OUT services OUT service is used to server both MDS-MDS updates and MDS-OST therefore services on MDT and OST are set to use the same request and reply portals to be fully unified and able to serve any type of requests. Signed-off-by: Mikhail Pershin Change-Id: Ifff20343d879552e7568399c021e2c8e8c3d6bf2 Reviewed-on: http://review.whamcloud.com/8390 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: wangdi Reviewed-by: Fan Yong Reviewed-by: Andreas Dilger --- lustre/fld/fld_request.c | 1 + lustre/ldlm/ldlm_lib.c | 53 +++++++++++++++++++++++++++--------------------- lustre/mdt/mdt_mds.c | 5 +++-- lustre/ost/ost_handler.c | 3 ++- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/lustre/fld/fld_request.c b/lustre/fld/fld_request.c index 93d1c1e..742afa8 100644 --- a/lustre/fld/fld_request.c +++ b/lustre/fld/fld_request.c @@ -444,6 +444,7 @@ int fld_client_rpc(struct obd_export *exp, ptlrpc_request_set_replen(req); req->rq_request_portal = FLD_REQUEST_PORTAL; + req->rq_reply_portal = MDC_REPLY_PORTAL; ptlrpc_at_set_req_timeout(req); if (fld_op == FLD_LOOKUP && diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 8360290..7c4bbb7 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -270,34 +270,41 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) char *name = obddev->obd_type->typ_name; ldlm_ns_type_t ns_type = LDLM_NS_TYPE_UNKNOWN; int rc; - char *cli_name = lustre_cfg_buf(lcfg, 0); ENTRY; /* In a more perfect world, we would hang a ptlrpc_client off of * obd_type and just use the values from there. */ - if (!strcmp(name, LUSTRE_OSC_NAME) || - (!(strcmp(name, LUSTRE_OSP_NAME)) && - (is_osp_on_mdt(cli_name) && - strstr(lustre_cfg_buf(lcfg, 1), "OST") != NULL))) { - /* OSC or OSP_on_MDT for OSTs */ - rq_portal = OST_REQUEST_PORTAL; - rp_portal = OSC_REPLY_PORTAL; - connect_op = OST_CONNECT; - cli->cl_sp_me = LUSTRE_SP_CLI; - cli->cl_sp_to = LUSTRE_SP_OST; - ns_type = LDLM_NS_TYPE_OSC; + if (!strcmp(name, LUSTRE_OSC_NAME)) { + rq_portal = OST_REQUEST_PORTAL; + rp_portal = OSC_REPLY_PORTAL; + connect_op = OST_CONNECT; + cli->cl_sp_me = LUSTRE_SP_CLI; + cli->cl_sp_to = LUSTRE_SP_OST; + ns_type = LDLM_NS_TYPE_OSC; } else if (!strcmp(name, LUSTRE_MDC_NAME) || - !strcmp(name, LUSTRE_LWP_NAME) || - (!strcmp(name, LUSTRE_OSP_NAME) && - (is_osp_on_mdt(cli_name) && - strstr(lustre_cfg_buf(lcfg, 1), "OST") == NULL))) { - /* MDC or OSP_on_MDT for other MDTs */ - rq_portal = MDS_REQUEST_PORTAL; - rp_portal = MDC_REPLY_PORTAL; - connect_op = MDS_CONNECT; - cli->cl_sp_me = LUSTRE_SP_CLI; - cli->cl_sp_to = LUSTRE_SP_MDT; - ns_type = LDLM_NS_TYPE_MDC; + !strcmp(name, LUSTRE_LWP_NAME)) { + rq_portal = MDS_REQUEST_PORTAL; + rp_portal = MDC_REPLY_PORTAL; + connect_op = MDS_CONNECT; + cli->cl_sp_me = LUSTRE_SP_CLI; + cli->cl_sp_to = LUSTRE_SP_MDT; + ns_type = LDLM_NS_TYPE_MDC; + } else if (!strcmp(name, LUSTRE_OSP_NAME)) { + if (strstr(lustre_cfg_buf(lcfg, 1), "OST") == NULL) { + /* OSP_on_MDT for other MDTs */ + connect_op = MDS_CONNECT; + cli->cl_sp_to = LUSTRE_SP_MDT; + ns_type = LDLM_NS_TYPE_MDC; + rq_portal = OUT_PORTAL; + } else { + /* OSP on MDT for OST */ + connect_op = OST_CONNECT; + cli->cl_sp_to = LUSTRE_SP_OST; + ns_type = LDLM_NS_TYPE_OSC; + rq_portal = OST_REQUEST_PORTAL; + } + rp_portal = OSC_REPLY_PORTAL; + cli->cl_sp_me = LUSTRE_SP_CLI; } else if (!strcmp(name, LUSTRE_MGC_NAME)) { rq_portal = MGS_REQUEST_PORTAL; rp_portal = MGC_REPLY_PORTAL; diff --git a/lustre/mdt/mdt_mds.c b/lustre/mdt/mdt_mds.c index 64231f7..367f659 100644 --- a/lustre/mdt/mdt_mds.c +++ b/lustre/mdt/mdt_mds.c @@ -288,7 +288,7 @@ static int mds_start_ptlrpc_service(struct mds_device *m) .bc_req_max_size = OUT_MAXREQSIZE, .bc_rep_max_size = OUT_MAXREPSIZE, .bc_req_portal = OUT_PORTAL, - .bc_rep_portal = MDC_REPLY_PORTAL, + .bc_rep_portal = OSC_REPLY_PORTAL, }, /* * We'd like to have a mechanism to set this on a per-device @@ -302,7 +302,8 @@ static int mds_start_ptlrpc_service(struct mds_device *m) .tc_nthrs_max = MDS_NTHRS_MAX, .tc_nthrs_user = mds_num_threads, .tc_cpu_affinity = 1, - .tc_ctx_tags = LCT_MD_THREAD, + .tc_ctx_tags = LCT_MD_THREAD | + LCT_DT_THREAD, }, .psc_cpt = { .cc_pattern = mds_num_cpts, diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 72010ba..662a489 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -768,7 +768,8 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg) .tc_nthrs_max = OSS_CR_NTHRS_MAX, .tc_nthrs_user = oss_num_create_threads, .tc_cpu_affinity = 1, - .tc_ctx_tags = LCT_DT_THREAD, + .tc_ctx_tags = LCT_MD_THREAD | + LCT_DT_THREAD, }, .psc_cpt = { .cc_pattern = oss_cpts, -- 1.8.3.1