]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
dm thin: add cond_resched() to various workqueue loops
authorMike Snitzer <snitzer@kernel.org>
Thu, 16 Feb 2023 20:29:44 +0000 (15:29 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:01 +0000 (09:34 +0100)
[ Upstream commit e4f80303c2353952e6e980b23914e4214487f2a6 ]

Otherwise on resource constrained systems these workqueues may be too
greedy.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-thin.c

index 196f82559ad6b97155c0a069fa968322fe07a1d6..d28c9077d6ed24a746fe88cb213c6e76cdf3165b 100644 (file)
@@ -2207,6 +2207,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);
 }
@@ -2289,6 +2290,7 @@ static void process_thin_deferred_cells(struct thin_c *tc)
                        else
                                pool->process_cell(tc, cell);
                }
+               cond_resched();
        } while (!list_empty(&cells));
 }