This is a note to let you know that I've just added the patch titled dm writecache: add cond_resched to loop in persistent_memory_claim() to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: dm-writecache-add-cond_resched-to-loop-in-persistent_memory_claim.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From d35bd764e6899a7bea71958f08d16cea5bfa1919 Mon Sep 17 00:00:00 2001 From: Mikulas Patocka <mpatocka@xxxxxxxxxx> Date: Fri, 19 Jun 2020 11:51:34 -0400 Subject: dm writecache: add cond_resched to loop in persistent_memory_claim() From: Mikulas Patocka <mpatocka@xxxxxxxxxx> commit d35bd764e6899a7bea71958f08d16cea5bfa1919 upstream. Add cond_resched() to a loop that fills in the mapper memory area because the loop can be executed many times. Fixes: 48debafe4f2fe ("dm: add writecache target") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx> Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/md/dm-writecache.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -281,6 +281,8 @@ static int persistent_memory_claim(struc while (daa-- && i < p) { pages[i++] = pfn_t_to_page(pfn); pfn.val++; + if (!(i & 15)) + cond_resched(); } } while (i < p); wc->memory_map = vmap(pages, p, VM_MAP, PAGE_KERNEL); Patches currently in stable-queue which might be from mpatocka@xxxxxxxxxx are queue-4.19/dm-writecache-add-cond_resched-to-loop-in-persistent_memory_claim.patch queue-4.19/dm-writecache-correct-uncommitted_block-when-discarding-uncommitted-entry.patch