From c3e985e7e98f41ebf5ecb78887dcd2554601f7ef Mon Sep 17 00:00:00 2001 From: Liang Zhen Date: Wed, 4 Jul 2012 12:21:38 +0800 Subject: [PATCH] LU-56 ptlrpc: post rqbd with flag LNET_INS_LOCAL LNet has a new flag LNET_INS_LOCAL which can be used by CPT affinity threads while posting buffer. (commit 279bbc81e03dc74d273ec12b4d9e703ca94404c4) Buffer posted with this flag will be attached on local partition only, and LND threads can find/match buffer by grabbing a local partition lock which is good for performance. This patch applied this flag to ptlrpc service. Signed-off-by: Liang Zhen Change-Id: I75cee15f125b033642195a71921dbc6ad4db5dfd Reviewed-on: http://review.whamcloud.com/3268 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger --- lustre/ptlrpc/niobuf.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 179a8a8..e517e10 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -775,10 +775,13 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd) if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_RQBD)) return (-ENOMEM); - /* NB: We need to replace LNET_INS_AFTER with LNET_INS_LOCAL - * after LNet SMP patches landed */ - rc = LNetMEAttach(service->srv_req_portal, - match_id, 0, ~0, LNET_UNLINK, LNET_INS_AFTER, &me_h); + /* NB: CPT affinity service should use new LNet flag LNET_INS_LOCAL, + * which means buffer can only be attached on local CPT, and LND + * threads can find it by grabbing a local lock */ + rc = LNetMEAttach(service->srv_req_portal, + match_id, 0, ~0, LNET_UNLINK, + rqbd->rqbd_svcpt->scp_cpt >= 0 ? + LNET_INS_LOCAL : LNET_INS_AFTER, &me_h); if (rc != 0) { CERROR("LNetMEAttach failed: %d\n", rc); return (-ENOMEM); -- 1.8.3.1