From: Mike Snitzer Date: Thu, 16 Feb 2023 20:29:44 +0000 (-0500) Subject: dm thin: add cond_resched() to various workqueue loops X-Git-Tag: v4.14.308~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=341c77bbed7cf76465ea9d2db9a4ef37fd8c95ec;p=thirdparty%2Fkernel%2Fstable.git dm thin: add cond_resched() to various workqueue loops [ Upstream commit e4f80303c2353952e6e980b23914e4214487f2a6 ] Otherwise on resource constrained systems these workqueues may be too greedy. Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 6c7fa790c8ae6..fcf1eaafec72d 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -2233,6 +2233,7 @@ static void process_thin_deferred_bios(struct thin_c *tc) throttle_work_update(&pool->throttle); dm_pool_issue_prefetches(pool->pmd); } + cond_resched(); } blk_finish_plug(&plug); } @@ -2316,6 +2317,7 @@ static void process_thin_deferred_cells(struct thin_c *tc) else pool->process_cell(tc, cell); } + cond_resched(); } while (!list_empty(&cells)); }