From 8930a68884d07fb02de6283758f5479f4e10e5f9 Mon Sep 17 00:00:00 2001 From: Alexey Lyashkov Date: Wed, 11 Oct 2023 12:04:32 +0300 Subject: [PATCH] LU-17181 misc: don't block reclaim threads memory reclaim threads may blocked by lustre reclaim process, but lustre don't have any benifit from parallel reclaim. Lustre-change: https://review.whamcloud.com/52627 Lustre-commit: 2c97684db9d9286a2916420138529b4fbd0e4bbe Test-Parameters: trivial HPe-bug-id: LUS-11872 Signed-off-by: Alexey Lyashkov Change-Id: I624edbb8833975864706ec51537d2954f5a9cea4 Reviewed-by: Andrew Perepechko Reviewed-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58768 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/obdclass/lu_object.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index c581211..e5ac808 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -2148,7 +2148,8 @@ static unsigned long lu_cache_shrink_count(struct shrinker *sk, if (!(sc->gfp_mask & __GFP_FS)) return 0; - down_read(&lu_sites_guard); + if (!down_read_trylock(&lu_sites_guard)) + return 0; list_for_each_entry_safe(s, tmp, &lu_sites, ls_linkage) cached += percpu_counter_read_positive(&s->ls_lru_len_counter); up_read(&lu_sites_guard); @@ -2182,7 +2183,9 @@ static unsigned long lu_cache_shrink_scan(struct shrinker *sk, */ return SHRINK_STOP; - down_write(&lu_sites_guard); + if (!down_write_trylock(&lu_sites_guard)) + return SHRINK_STOP; + list_for_each_entry_safe(s, tmp, &lu_sites, ls_linkage) { remain = lu_site_purge(&lu_shrink_env, s, remain); /* -- 1.8.3.1