From 3c639b294cecec2f2c59bc17945705d8c5e63690 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Tue, 9 Apr 2024 13:35:00 +0300 Subject: [PATCH] LU-17630 osc: add cond_resched() to osc_lru_shrink() osc_lru_shrink() may need to handle lots of pages and this way can block scheduling for long. add couple cond_resched() to prevent kernel warnings and other thread's starvation. Lustre-change: https://review.whamcloud.com/54346 Lustre-commit: 69eb7b89c7f36ec6a8970e87fc8859207f4b9c0c Signed-off-by: Alex Zhuravlev Change-Id: I862c568ac777c0b929a1ffb61e246b079aee6718 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54708 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/osc/osc_page.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lustre/osc/osc_page.c b/lustre/osc/osc_page.c index 633072d..435a30a 100644 --- a/lustre/osc/osc_page.c +++ b/lustre/osc/osc_page.c @@ -621,6 +621,7 @@ long osc_lru_shrink(const struct lu_env *env, struct client_obd *cli, cl_io_fini(env, io); cl_object_put(env, clobj); clobj = NULL; + cond_resched(); } clobj = tmp; @@ -676,6 +677,7 @@ long osc_lru_shrink(const struct lu_env *env, struct client_obd *cli, cl_io_fini(env, io); cl_object_put(env, clobj); + cond_resched(); } atomic_dec(&cli->cl_lru_shrinkers); -- 1.8.3.1