Whamcloud - gitweb
LU-6770 osc: use global osc_rq_pool to reduce memory usage 22/15422/13
authorLi Xi <lixi@ddn.com>
Mon, 13 Jul 2015 14:29:54 +0000 (22:29 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 12 Aug 2015 23:44:39 +0000 (23:44 +0000)
commit44c4f47c4d1f185831d4629cc9ca5ae5f50a8e07
tree86a9e48745869f09be100e520774834d7e00f9b0
parentc45c8ad26004a577dd7ad4270f2756e1f2943639
LU-6770 osc: use global osc_rq_pool to reduce memory usage

The per-osc request pools consume a lot of memory if there are
hundreds of OSCs on one client. This will be a critical problem
if the client doesn't have sufficient memory for both OSCs and
applications.

This patch replaces per-osc request pools with a global pool
osc_rq_pool. The total memory usage is 5MB by default. And it
can be set by a module parameter of OSC:
"options osc osc_reqpool_mem_max=POOL_SIZE". The unit of POOL_SIZE
is MB. If cl_max_rpcs_in_flight is the same for all OSCs, the
memory usage of the OSC pool can be calculated as:
Min(POOL_SIZE * 1M,
    (cl_max_rpcs_in_flight + 2) * OSC number * OST_IO_MAXREQSIZE)

Also, this patch changes the allocation logic of OSC write requests.
The allocation from osc_rq_pool will only be tried after normal
allocation failed.

Signed-off-by: Wu Libin <lwu@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: I1b0c522ade01dba11d860ab57f83af53619ce4ba
Reviewed-on: http://review.whamcloud.com/15422
Tested-by: Jenkins
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre_import.h
lustre/include/lustre_net.h
lustre/include/obd_class.h
lustre/obdclass/genops.c
lustre/osc/lproc_osc.c
lustre/osc/osc_internal.h
lustre/osc/osc_request.c
lustre/osp/lwp_dev.c
lustre/osp/osp_dev.c
lustre/ptlrpc/client.c