From 21ade34764d11498abece590b965ce766f31de88 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 6 May 2011 15:12:15 -0700 Subject: Disable direct reclaim for z_wr_* threads The direct reclaim path in the z_wr_* threads must be disabled to ensure forward progress is always maintained for txg processing. This ensures that a txg will never get stuck waiting on itself because it entered the following memory reclaim callpath. ->prune_icache()->dispose_list()->zpl_clear_inode()->zfs_inactive() ->dmu_tx_assign()->dmu_tx_wait()->tgx_wait_open() It would be preferable to target this exact code path but the kernel offers no way to do this without custom patches. To avoid this we are forced to disable all reclaim for these threads. It should not be necessary to do this for other other z_* threads because they will not hold a txg open. Closes #232 --- include/sys/zfs_context.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sys/zfs_context.h') diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index 2ac41e007..1027e7215 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -368,6 +368,7 @@ typedef void (task_func_t)(void *); #define TASKQ_DYNAMIC 0x0004 /* Use dynamic thread scheduling */ #define TASKQ_THREADS_CPU_PCT 0x0008 /* Scale # threads by # cpus */ #define TASKQ_DC_BATCH 0x0010 /* Mark threads as batch */ +#define TASKQ_NORECLAIM 0x0020 /* Disable direct memory reclaim */ #define TQ_SLEEP KM_SLEEP /* Can block for memory */ #define TQ_NOSLEEP KM_NOSLEEP /* cannot block for memory; may fail */ -- cgit v1.2.3