dm writecache: add cond_resched to loop in persistent_memory_claim()
commit5.4-rM2-2.2.x-imx-squashedd35bd764e6
upstream. Add cond_resched() to a loop that fills in the mapper memory area because the loop can be executed many times. Fixes:48debafe4f
("dm: add writecache target") Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
parent
a51e71cbf6
commit
cc66553004
|
@ -279,6 +279,8 @@ static int persistent_memory_claim(struct dm_writecache *wc)
|
||||||
while (daa-- && i < p) {
|
while (daa-- && i < p) {
|
||||||
pages[i++] = pfn_t_to_page(pfn);
|
pages[i++] = pfn_t_to_page(pfn);
|
||||||
pfn.val++;
|
pfn.val++;
|
||||||
|
if (!(i & 15))
|
||||||
|
cond_resched();
|
||||||
}
|
}
|
||||||
} while (i < p);
|
} while (i < p);
|
||||||
wc->memory_map = vmap(pages, p, VM_MAP, PAGE_KERNEL);
|
wc->memory_map = vmap(pages, p, VM_MAP, PAGE_KERNEL);
|
||||||
|
|
Loading…
Reference in New Issue