dm cache: add cond_resched() to various workqueue loops
[ Upstream commit 76227f6dc8
]
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>
This commit is contained in:
Родитель
01663c2158
Коммит
8c5f6c6992
|
@ -1813,6 +1813,7 @@ static void process_deferred_bios(struct work_struct *ws)
|
|||
|
||||
else
|
||||
commit_needed = process_bio(cache, bio) || commit_needed;
|
||||
cond_resched();
|
||||
}
|
||||
|
||||
if (commit_needed)
|
||||
|
@ -1835,6 +1836,7 @@ static void requeue_deferred_bios(struct cache *cache)
|
|||
while ((bio = bio_list_pop(&bios))) {
|
||||
bio->bi_status = BLK_STS_DM_REQUEUE;
|
||||
bio_endio(bio);
|
||||
cond_resched();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1875,6 +1877,8 @@ static void check_migrations(struct work_struct *ws)
|
|||
r = mg_start(cache, op, NULL);
|
||||
if (r)
|
||||
break;
|
||||
|
||||
cond_resched();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче