Whamcloud - gitweb
LU-12477 libcfs: Further reduce complexity for shrinkers.
authorMr NeilBrown <neilb@suse.de>
Mon, 31 Jul 2023 21:18:03 +0000 (14:18 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 1 Aug 2023 22:04:03 +0000 (22:04 +0000)
commita0dfd47f59ef632a50a5ce98486daf278ca54b4f
tree09c155bf03c080a39497df2c481c6b2dc9b7a1a5
parentde37834f1ec61ea56c02d9065083c5b1af827c75
LU-12477 libcfs: Further reduce  complexity for shrinkers.

Commit c4c17fa4a3f5 ("LU-12477 libcfs: Remove obsolete config checks")
reduced the complexity of shinkers by removing support for older
kernels, but could have gone a lot further.  This patch adds
further simplification.

Lustre-change: https://review.whamcloud.com/40831
Lustre-commit: 782725b11021b2f1c3467863216836ee94bcd874

LU-12477 lustre: check return status of register_shrinker()

register_shrinker() can fail with -ENOMEM.  We should check for that
and abort the relevant initialization functions when it happens.

For ldlm_pools, ldlm_pools_fini() can be called when ldlm_pools_init()
fails, or even in case where it hasn't been called.  So add a static
flag to ensure we ldlm_pools_fini() do not undo things that haven't been
done.

For lu_global_init() we need to add proper cleanup if anything fails.

Lustre-change: https://review.whamcloud.com/40883
Lustre-commit: 812b2ccf0284df42e8a88a6b7c4c3874dd721c71

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Signed-off-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Change-Id: Ibcc84f61e542b503f795b16a7144e430f8b73582
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51778
Tested-by: Jian Yu <yujian@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
libcfs/include/libcfs/linux/linux-mem.h
lustre/autoconf/lustre-core.m4
lustre/include/lustre_compat.h
lustre/ldlm/ldlm_pool.c
lustre/obdclass/lu_object.c
lustre/osc/osc_request.c
lustre/ptlrpc/sec_bulk.c