Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38b4d3ea authored by Mike Snitzer's avatar Mike Snitzer Committed by Greg Kroah-Hartman
Browse files

dm cache: add cond_resched() to various workqueue loops



[ Upstream commit 76227f6dc805e9e960128bcc6276647361e0827c ]

Otherwise on resource constrained systems these workqueues may be too
greedy.

Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 3b46b2cb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1910,6 +1910,7 @@ static void process_deferred_bios(struct work_struct *ws)

		else
			commit_needed = process_bio(cache, bio) || commit_needed;
		cond_resched();
	}

	if (commit_needed)
@@ -1932,6 +1933,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();
	}
}

@@ -1972,6 +1974,8 @@ static void check_migrations(struct work_struct *ws)
		r = mg_start(cache, op, NULL);
		if (r)
			break;

		cond_resched();
	}
}