]> git.ipfire.org Git - thirdparty/kernel/stable.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>
Sat, 11 Mar 2023 15:26:43 +0000 (16:26 +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 6c7fa790c8ae6815cb92b14e0e10f1e3c53da6e0..fcf1eaafec72deab172034d7a7f6ed511ad167d3 100644 (file)
@@ -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));
 }