[PATCH] dm-writecache: add cond_resched to a loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add cond_resched to a loop that fills in the mapper memory area because
the loop can be executed many times.

Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx

---
 drivers/md/dm-writecache.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6/drivers/md/dm-writecache.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-writecache.c	2020-05-18 15:43:24.218771000 +0200
+++ linux-2.6/drivers/md/dm-writecache.c	2020-05-18 17:13:43.239999000 +0200
@@ -282,6 +282,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);

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux