Skip to content

Commit

Permalink
Set spl_kmem_cache_slab_limit=16384 to default
Browse files Browse the repository at this point in the history
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
  • Loading branch information
behlendorf committed Aug 8, 2014
1 parent c1aef26 commit f2297b5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions module/spl/spl-kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit f2297b5

Please sign in to comment.