[PATCH] rbd: rbd workqueues need a resque worker

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

 



Backport of commit 792c3a914910bd34302c5345578f85cfcb5e2c01 for 3.16.

Need to use WQ_MEM_RECLAIM for our workqueues to prevent I/O lockups
under memory pressure - we sit on the memory reclaim path.

Cc: stable@xxxxxxxxxxxxxxx # 3.17, needs backporting for 3.16
Signed-off-by: Ilya Dryomov <idryomov@xxxxxxxxxx>
Tested-by: Micha Krause <micha@xxxxxxxxxx>
Reviewed-by: Sage Weil <sage@xxxxxxxxxx>
[idryomov@xxxxxxxxxx: backport to 3.16]
---
 drivers/block/rbd.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 9dc02c429771..e436cde1b24e 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5103,9 +5103,12 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev)
 	set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
 	set_disk_ro(rbd_dev->disk, rbd_dev->mapping.read_only);
 
-	rbd_dev->rq_wq = alloc_workqueue(rbd_dev->disk->disk_name, 0, 0);
-	if (!rbd_dev->rq_wq)
+	rbd_dev->rq_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0,
+					 rbd_dev->disk->disk_name);
+	if (!rbd_dev->rq_wq) {
+		ret = -ENOMEM;
 		goto err_out_mapping;
+	}
 
 	ret = rbd_bus_add_dev(rbd_dev);
 	if (ret)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]