Add TASKQ_NORECLAIM flag

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.
This commit is contained in:
Brian Behlendorf 2011-05-06 15:21:58 -07:00
parent dde6b7b137
commit 372c257233
2 changed files with 5 additions and 0 deletions

View 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 *);

View 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);