From: Brian Behlendorf Date: Fri, 6 May 2011 22:21:58 +0000 (-0700) Subject: Add TASKQ_NORECLAIM flag X-Git-Tag: debian/0.7.9-2~291^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=372c2572336468cbf60272aa7e735b7ca0c3807c;p=mirror_spl-debian.git 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. --- diff --git a/include/sys/taskq.h b/include/sys/taskq.h index c83409d..57f8b1c 100644 --- a/include/sys/taskq.h +++ b/include/sys/taskq.h @@ -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 *); diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index 5a17f1c..f9ee570 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -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);