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:39:54 +0000 (09:39 +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 cce26f46ded5279ba8de2536d0bad6ab08bcca4d..f7124f257703c711c62c73b035447d49ed6986a2 100644 (file)
@@ -2217,6 +2217,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);
 }
@@ -2299,6 +2300,7 @@ static void process_thin_deferred_cells(struct thin_c *tc)
                        else
                                pool->process_cell(tc, cell);
                }
+               cond_resched();
        } while (!list_empty(&cells));
 }