Skip to content

Commit edb930b

Browse files
Mikulas PatockaSasha Levin
authored andcommitted
dm writecache: add cond_resched to loop in persistent_memory_claim()
commit d35bd76 upstream. Add cond_resched() to a loop that fills in the mapper memory area because the loop can be executed many times. Fixes: 48debaf ("dm: add writecache target") Cc: [email protected] Signed-off-by: Mikulas Patocka <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 22551da commit edb930b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/md/dm-writecache.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ static int persistent_memory_claim(struct dm_writecache *wc)
286286
while (daa-- && i < p) {
287287
pages[i++] = pfn_t_to_page(pfn);
288288
pfn.val++;
289+
if (!(i & 15))
290+
cond_resched();
289291
}
290292
} while (i < p);
291293
wc->memory_map = vmap(pages, p, VM_MAP, PAGE_KERNEL);

0 commit comments

Comments
 (0)