Skip to content

Commit 76227f6

Browse files
author
Mike Snitzer
committed
dm cache: add cond_resched() to various workqueue loops
Otherwise on resource constrained systems these workqueues may be too greedy. Signed-off-by: Mike Snitzer <[email protected]>
1 parent e4f8030 commit 76227f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/md/dm-cache-target.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,6 +1829,7 @@ static void process_deferred_bios(struct work_struct *ws)
18291829

18301830
else
18311831
commit_needed = process_bio(cache, bio) || commit_needed;
1832+
cond_resched();
18321833
}
18331834

18341835
if (commit_needed)
@@ -1852,6 +1853,7 @@ static void requeue_deferred_bios(struct cache *cache)
18521853
while ((bio = bio_list_pop(&bios))) {
18531854
bio->bi_status = BLK_STS_DM_REQUEUE;
18541855
bio_endio(bio);
1856+
cond_resched();
18551857
}
18561858
}
18571859

@@ -1892,6 +1894,8 @@ static void check_migrations(struct work_struct *ws)
18921894
r = mg_start(cache, op, NULL);
18931895
if (r)
18941896
break;
1897+
1898+
cond_resched();
18951899
}
18961900
}
18971901

0 commit comments

Comments
 (0)