diff options
author | Michael Niewöhner <[email protected]> | 2019-07-21 19:34:10 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-11-13 10:05:23 -0800 |
commit | 6d948c3519ab7a52c06f68927737a3199ba13f81 (patch) | |
tree | 5c3ce17100b7959308857f536bbdf5620eff04fc /include | |
parent | 66955885e24427a94e938c013da214bd5c0177d4 (diff) |
Add kmem_cache flag for forcing kvmalloc
This adds a new KMC_KVMEM flag was added to enforce use of the
kvmalloc allocator in kmem_cache_create even for large blocks, which
may also increase performance in some specific cases (e.g. zstd), too.
Default to KVMEM instead of VMEM in spl_kmem_cache_create.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Matt Ahrens <[email protected]>
Signed-off-by: Sebastian Gottschall <[email protected]>
Signed-off-by: Michael Niewöhner <[email protected]>
Closes #9034
Diffstat (limited to 'include')
-rw-r--r-- | include/os/linux/spl/sys/kmem_cache.h | 6 | ||||
-rw-r--r-- | include/sys/zfs_context.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/include/os/linux/spl/sys/kmem_cache.h b/include/os/linux/spl/sys/kmem_cache.h index 3584eefdf..5667382f7 100644 --- a/include/os/linux/spl/sys/kmem_cache.h +++ b/include/os/linux/spl/sys/kmem_cache.h @@ -43,8 +43,9 @@ typedef enum kmc_bit { KMC_BIT_QCACHE = 4, /* XXX: Unsupported */ KMC_BIT_KMEM = 5, /* Use kmem cache */ KMC_BIT_VMEM = 6, /* Use vmem cache */ - KMC_BIT_SLAB = 7, /* Use Linux slab cache */ - KMC_BIT_OFFSLAB = 8, /* Objects not on slab */ + KMC_BIT_KVMEM = 7, /* Use kvmalloc linux allocator */ + KMC_BIT_SLAB = 8, /* Use Linux slab cache */ + KMC_BIT_OFFSLAB = 9, /* Objects not on slab */ KMC_BIT_DEADLOCKED = 14, /* Deadlock detected */ KMC_BIT_GROWING = 15, /* Growing in progress */ KMC_BIT_REAPING = 16, /* Reaping in progress */ @@ -70,6 +71,7 @@ typedef enum kmem_cbrc { #define KMC_QCACHE (1 << KMC_BIT_QCACHE) #define KMC_KMEM (1 << KMC_BIT_KMEM) #define KMC_VMEM (1 << KMC_BIT_VMEM) +#define KMC_KVMEM (1 << KMC_BIT_KVMEM) #define KMC_SLAB (1 << KMC_BIT_SLAB) #define KMC_OFFSLAB (1 << KMC_BIT_OFFSLAB) #define KMC_DEADLOCKED (1 << KMC_BIT_DEADLOCKED) diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index e915f0a8f..f221091d8 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -406,6 +406,7 @@ void procfs_list_add(procfs_list_t *procfs_list, void *p); #define KMC_NODEBUG UMC_NODEBUG #define KMC_KMEM 0x0 #define KMC_VMEM 0x0 +#define KMC_KVMEM 0x0 #define kmem_alloc(_s, _f) umem_alloc(_s, _f) #define kmem_zalloc(_s, _f) umem_zalloc(_s, _f) #define kmem_free(_b, _s) umem_free(_b, _s) |