[PATCH] brd: add cond_resched to brd_free_pages

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

 



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

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

---
 drivers/block/brd.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-4.19.41/drivers/block/brd.c
===================================================================
--- linux-4.19.41.orig/drivers/block/brd.c	2019-01-22 12:26:42.000000000 +0100
+++ linux-4.19.41/drivers/block/brd.c	2019-05-09 17:09:11.000000000 +0200
@@ -157,6 +157,8 @@ static void brd_free_pages(struct brd_de
 
 		pos++;
 
+		cond_resched();
+
 		/*
 		 * This assumes radix_tree_gang_lookup always returns as
 		 * many pages as possible. If the radix-tree code changes,



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux