Whamcloud - gitweb
LU-56 ptlrpc: post rqbd with flag LNET_INS_LOCAL
authorLiang Zhen <liang@whamcloud.com>
Wed, 4 Jul 2012 04:21:38 +0000 (12:21 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 6 Jul 2012 05:20:12 +0000 (01:20 -0400)
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 <liang@whamcloud.com>
Change-Id: I75cee15f125b033642195a71921dbc6ad4db5dfd
Reviewed-on: http://review.whamcloud.com/3268
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/ptlrpc/niobuf.c

index 179a8a8..e517e10 100644 (file)
@@ -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);