lkml.org 
[lkml]   [2023]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.10 17/19] dm thin: add cond_resched() to various workqueue loops
    Date
    From: Mike Snitzer <snitzer@kernel.org>

    [ 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 | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
    index f3c519e18a12f..c890bb3e51852 100644
    --- a/drivers/md/dm-thin.c
    +++ b/drivers/md/dm-thin.c
    @@ -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));
    }

    --
    2.39.0
    \
     
     \ /
      Last update: 2023-03-27 00:36    [W:4.085 / U:0.888 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site