Whamcloud - gitweb
LU-9514 ptlrpc: free reply buffer earlier for open RPC 17/28217/2
authorFan Yong <fan.yong@intel.com>
Wed, 14 Jun 2017 09:03:46 +0000 (17:03 +0800)
committerJohn L. Hammond <john.hammond@intel.com>
Thu, 3 Aug 2017 21:40:34 +0000 (21:40 +0000)
commita9d4e4b6a17bec691ce32460fdf9057ec080a738
tree2cdb56ea142078ded8b41489afed86648c66ed3f
parent39c090bdb9beacc0837cf921d87a451308364131
LU-9514 ptlrpc: free reply buffer earlier for open RPC

It is unnecessary to keep the reply buffer for open RPC. Replay
related data has already been saved in the request buffer when
the RPC replied. If the open replay really happen, the replay
logic will alloc the reply buffer when needed.

On the other hand, the client always tries to alloc big enough
space to hold the open RPC reply since the client does not exactly
know how much data the server will reply to the client. So the reply
buffer may be quite larger than the real needed. Under such case,
keeping the large reply buffer for the open RPC will occupy a lot
of RAM as to OOM if the are too many open RPCs to be replayed.

This patch frees the reply buffer for the open RPC when only
the replay logic holds the last reference of the RPC.

Lustre-change: https://review.whamcloud.com/27208
Lustre-commit: c8e3992acf3039b2824725d41f90d9a3be3be921

Test-Parameters: envdefinitions=ONLY=51f testlist=sanity ostfilesystemtype=ldiskfs mdtfilesystemtype=ldiskfs
Test-Parameters: envdefinitions=ONLY=51f testlist=sanity ostfilesystemtype=zfs mdtfilesystemtype=zfs
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I1bea2456b8aa4e53a0b65143a48e617f836181a0
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/28217
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/include/lustre_net.h
lustre/mdc/mdc_request.c
lustre/ptlrpc/client.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/ptlrpc_internal.h
lustre/tests/sanity.sh