diff --git a/module/os/linux/spl/spl-kmem-cache.c b/module/os/linux/spl/spl-kmem-cache.c index 6b3d559ffc1c..4b7867b7eb78 100644 --- a/module/os/linux/spl/spl-kmem-cache.c +++ b/module/os/linux/spl/spl-kmem-cache.c @@ -100,12 +100,13 @@ MODULE_PARM_DESC(spl_kmem_cache_max_size, "Maximum size of slab in MB"); * For small objects the Linux slab allocator should be used to make the most * efficient use of the memory. However, large objects are not supported by * the Linux slab and therefore the SPL implementation is preferred. A cutoff - * of 16K was determined to be optimal for architectures using 4K pages. + * of 16K was determined to be optimal for architectures using 4K pages. For + * larger page sizes set the cutoff at a single page. */ -#if PAGE_SIZE == 4096 +#if PAGE_SIZE <= 16384 unsigned int spl_kmem_cache_slab_limit = 16384; #else -unsigned int spl_kmem_cache_slab_limit = 0; +unsigned int spl_kmem_cache_slab_limit = PAGE_SIZE; #endif module_param(spl_kmem_cache_slab_limit, uint, 0644); MODULE_PARM_DESC(spl_kmem_cache_slab_limit,