aboutsummaryrefslogtreecommitdiffstats
path: root/include/os/linux
diff options
context:
space:
mode:
authorMichael Niewöhner <[email protected]>2019-07-21 19:34:10 +0200
committerBrian Behlendorf <[email protected]>2019-11-13 10:05:23 -0800
commit6d948c3519ab7a52c06f68927737a3199ba13f81 (patch)
tree5c3ce17100b7959308857f536bbdf5620eff04fc /include/os/linux
parent66955885e24427a94e938c013da214bd5c0177d4 (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/os/linux')
-rw-r--r--include/os/linux/spl/sys/kmem_cache.h6
1 files changed, 4 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)