Whamcloud - gitweb
LU-179 Should let PF_MEMALLOC cover ptlrpc_register_bulk()
authorBobi Jam <bobijam@whamcloud.com>
Wed, 20 Apr 2011 04:14:41 +0000 (12:14 +0800)
committerJohann Lombardi <johann@whamcloud.com>
Wed, 20 Apr 2011 13:32:35 +0000 (06:32 -0700)
Under memory pressure, the rpc memory allocation in bulk registration on the memory
release path also needs be covered.

Change-Id: Ie4986eb48d1e5b99b1756a0ddaa11fe0beb37462
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/439
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/ptlrpc/niobuf.c

index 25c1df5..11cfd3b 100644 (file)
@@ -518,12 +518,6 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
 
         connection = request->rq_import->imp_connection;
 
-        if (request->rq_bulk != NULL) {
-                rc = ptlrpc_register_bulk (request);
-                if (rc != 0)
-                        RETURN(rc);
-        }
-
         lustre_msg_set_handle(request->rq_reqmsg,
                               &request->rq_import->imp_remote_handle);
         lustre_msg_set_type(request->rq_reqmsg, PTL_RPC_MSG_REQUEST);
@@ -538,6 +532,12 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
         if (request->rq_memalloc)
                 mpflag = libcfs_memory_pressure_get_and_set();
 
+        if (request->rq_bulk != NULL) {
+                rc = ptlrpc_register_bulk (request);
+                if (rc != 0)
+                        GOTO(out, rc);
+        }
+
         if (!noreply) {
                 LASSERT (request->rq_replen != 0);
                 if (request->rq_repbuf == NULL)