Whamcloud - gitweb
LU-13096 llite: serialize max_cached_mb write operation 10/37710/5
authorWang Shilong <wshilong@ddn.com>
Tue, 25 Feb 2020 10:51:43 +0000 (18:51 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 17 Mar 2020 03:40:48 +0000 (03:40 +0000)
commite4d63c854d774792f8a77b8d1e575ccc2d8c3c8b
treeddbfa2952009d07c46c960e9322a06bcbb1b4ddb
parent7889a3e5df914f70d4b405779f9d04251c80a5d5
LU-13096 llite: serialize max_cached_mb write operation

It is possible that two threads try to change max_cached_mb concurrently,
if they both try to reclaim LRU pages, it will be possible
that one thread finish, but another thread loop forever to reclaim
enough LRU pages.

Morever, this operations try to change two value, they should be
protected together to guarantee atomic, the whole operations could
be slow, this patch introduce another mutex lock to serialize operation.

Patch also fix to avoid reclaim too many LRU pages with large memory.

Change-Id: I1e88e37607f9e8db2ba67f1f7e5670f25c136465
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/37710
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/cl_object.h
lustre/llite/lproc_llite.c
lustre/obdclass/cl_page.c