summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2014-08-07 16:23:04 -0700
committerBrian Behlendorf <[email protected]>2014-08-08 08:51:45 -0700
commitf2297b5a8932594a45c99d3d01b0d53a16ea9753 (patch)
treead50b150984912e3b838e9b9d9ceebdb1302a3cd
parentc1aef26944ca8bc18e9f46f464c2957890c707e9 (diff)
Set spl_kmem_cache_slab_limit=16384 to default
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. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: DHE <[email protected]> Issue #356 Closes #379
-rw-r--r--module/spl/spl-kmem.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c
index 0d1da4378..0a9d77534 100644
--- a/module/spl/spl-kmem.c
+++ b/module/spl/spl-kmem.c
@@ -81,7 +81,17 @@ unsigned int spl_kmem_cache_max_size = 32;
module_param(spl_kmem_cache_max_size, uint, 0644);
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.
+ */
+#if PAGE_SIZE == 4096
+unsigned int spl_kmem_cache_slab_limit = 16384;
+#else
unsigned int spl_kmem_cache_slab_limit = 0;
+#endif
module_param(spl_kmem_cache_slab_limit, uint, 0644);
MODULE_PARM_DESC(spl_kmem_cache_slab_limit,
"Objects less than N bytes use the Linux slab");