]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Add TASKQ_NORECLAIM flag
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 6 May 2011 22:21:58 +0000 (15:21 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 6 May 2011 22:23:58 +0000 (15:23 -0700)
It has become necessary to be able to optionally disable
direct memory reclaim for certain taskqs.  To support
this the TASKQ_NORECLAIM flags has been added which sets
the PF_MEMALLOC bit for all threads in the taskq.

include/sys/taskq.h
module/spl/spl-taskq.c

index c83409d4936ffc4c2d0731bc0ca297636ad35210..57f8b1cb59cfcb2c81866414bff8826cf101a03c 100644 (file)
@@ -40,6 +40,7 @@
 #define TASKQ_DYNAMIC           0x00000004
 #define TASKQ_THREADS_CPU_PCT   0x00000008
 #define TASKQ_DC_BATCH          0x00000010
+#define TASKQ_NORECLAIM         0x00000020
 
 typedef unsigned long taskqid_t;
 typedef void (task_func_t)(void *);
index 5a17f1ccf56f5c9904c83c6e60b80ca823d4c4ed..f9ee570351c4acb7f125b99c10a86a1844058ddc 100644 (file)
@@ -371,6 +371,10 @@ taskq_thread(void *args)
         ASSERT(tq);
         current->flags |= PF_NOFREEZE;
 
+       /* Disable the direct memory reclaim path */
+       if (tq->tq_flags & TASKQ_NORECLAIM)
+               current->flags |= PF_MEMALLOC;
+
         sigfillset(&blocked);
         sigprocmask(SIG_BLOCK, &blocked, NULL);
         flush_signals(current);