From 134461a981b134de896d9aa9cc6ec2d816cfa044 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Wed, 20 Apr 2011 12:14:41 +0800 Subject: [PATCH] LU-179 Should let PF_MEMALLOC cover ptlrpc_register_bulk() 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 Reviewed-on: http://review.whamcloud.com/439 Reviewed-by: Liang Zhen Tested-by: Hudson Reviewed-by: Johann Lombardi --- lustre/ptlrpc/niobuf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 25c1df5..11cfd3b 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -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) -- 1.8.3.1