Skip to content
Snippets Groups Projects
Commit 936b33f7 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Jens Axboe
Browse files

brd: add cond_resched to brd_free_pages


The loop that frees all the pages can take unbounded amount of time, so
add cond_resched() to it.

Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent cf12c672
No related branches found
No related tags found
No related merge requests found
......@@ -152,6 +152,12 @@ static void brd_free_pages(struct brd_device *brd)
pos++;
/*
* It takes 3.4 seconds to remove 80GiB ramdisk.
* So, we need cond_resched to avoid stalling the CPU.
*/
cond_resched();
/*
* This assumes radix_tree_gang_lookup always returns as
* many pages as possible. If the radix-tree code changes,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment