Whamcloud - gitweb
LU-6529 ldlm: reclaim granted locks defensively 31/14931/11
authorNiu Yawei <yawei.niu@intel.com>
Thu, 21 May 2015 15:07:54 +0000 (11:07 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 19 Jul 2015 04:29:19 +0000 (04:29 +0000)
commitfe60e0135ee2334440247cde167b707b223cf11d
tree2cba15cd006314e187cd546767e22c199ef079e9
parentba64569830ea03f6389fd4580b248cfc654e88c3
LU-6529 ldlm: reclaim granted locks defensively

To avoid ldlm lock exhausting server memory, two global parameters:
ldlm_watermark_low & ldlm_watermark_high are used for reclaiming
granted locks and rejecting incoming enqueue requests defensively.

ldlm_watermark_low: When the amount of granted locks reaching this
threshold, server start to revoke locks gradually.

ldlm_watermark_high: When the amount of granted locks reaching this
threshold, server will return -EINPROGRESS to any incoming enqueue
request until the lock count is shrunk below the threshold again.

ldlm_watermark_low & ldlm_watermark_high is set to 20% & 30% of the
total memory by default. It is tunable via proc entry, when it's set
to 0, the feature is disabled.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I2fab39ac0ab6f269b7f1a40f3e08b8a51807cc69
Reviewed-on: http://review.whamcloud.com/14931
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
16 files changed:
libcfs/include/libcfs/libcfs_hash.h
libcfs/libcfs/hash.c
lustre/include/lustre_dlm.h
lustre/include/obd_support.h
lustre/ldlm/Makefile.am
lustre/ldlm/ldlm_internal.h
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_pool.c
lustre/ldlm/ldlm_reclaim.c [new file with mode: 0644]
lustre/ldlm/ldlm_request.c
lustre/ldlm/ldlm_resource.c
lustre/mdc/mdc_locks.c
lustre/ofd/ofd_dev.c
lustre/ptlrpc/Makefile.in
lustre/tests/sanity.sh