From 1329003c03d7a40262cad74c1446313eb94a0f9a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 30 Jul 2024 08:40:19 -0700 Subject: [PATCH] LU-18053 osc: add another cond_resched() to osc_lru_shrink() When discarding pages osc_lru_shrink() eventually calls delete_from_page_cache() which must aquire a spin lock on the page cache. On systems with a large number of CPUs this can result in spinlock contention and soft lockups. Add a call to cond_resched() to yield the CPU as needed. This is a follow up to LU-17630. Lustre-change: https://review.whamcloud.com/55888 Lustre-commit: 66549c1540b2931ae1d1d1ebb50afbf15683baf4 Change-Id: I1ebf940a9a96c433f527f3e0dd9dc765b2645c97 Reviewed-by: Qian Yingjin Reviewed-by: Alexander Zarochentsev Reviewed-by: Patrick Farrell Signed-off-by: Eric Carbonneau Signed-off-by: Brian Behlendorf Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56390 Tested-by: Maloo Tested-by: jenkins Reviewed-by: Olaf Faaland Reviewed-by: Oleg Drokin Reviewed-by: Patrick Farrell --- lustre/osc/osc_page.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/osc/osc_page.c b/lustre/osc/osc_page.c index 0bdf844..28429a3 100644 --- a/lustre/osc/osc_page.c +++ b/lustre/osc/osc_page.c @@ -661,6 +661,7 @@ long osc_lru_shrink(const struct lu_env *env, struct client_obd *cli, discard_cl_pages(env, io, pvec, index); index = 0; + cond_resched(); spin_lock(&cli->cl_lru_list_lock); } -- 1.8.3.1