]> granicus.if.org Git - zfs/blobdiff - module/zfs/zvol.c
Disable direct reclaim on zvols
[zfs] / module / zfs / zvol.c
index 9b13134024f8964b080dffd0d33862e2d433731e..9dd9547e24b96f05261fefa5827a03acbf6ccfee 100644 (file)
@@ -1390,8 +1390,14 @@ zvol_init(void)
 {
        int error;
 
+       /*
+        * The zvol taskqs are created with TASKQ_NORECLAIM so they may be
+        * used safely as a swap device.  If direct reclaim is allowed then
+        * they quickly deadlock in one of the internal memory allocations.
+        */
        zvol_taskq = taskq_create(ZVOL_DRIVER, zvol_threads, maxclsyspri,
-                                 zvol_threads, INT_MAX, TASKQ_PREPOPULATE);
+                                 zvol_threads, INT_MAX,
+                                 TASKQ_PREPOPULATE | TASKQ_NORECLAIM);
        if (zvol_taskq == NULL) {
                printk(KERN_INFO "ZFS: taskq_create() failed\n");
                return (-ENOMEM);