]> git.baikalelectronics.ru Git - kernel.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:43:58 +0000 (16:43 +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 4f161725dda0a2d784c5ea9b001012010d03c4d3..999447bde8203ee180c2a641b57bdd0076bce89d 100644 (file)
@@ -2224,6 +2224,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);
 }
@@ -2307,6 +2308,7 @@ static void process_thin_deferred_cells(struct thin_c *tc)
                        else
                                pool->process_cell(tc, cell);
                }
+               cond_resched();
        } while (!list_empty(&cells));
 }