zfs/module/os/linux/spl
Brian Behlendorf 7837845822
Linux: Set spl_kmem_cache_slab_limit when page size !4K
For small objects the kernel's slab implementation is very fast and
space efficient. However, as the allocation size increases to
require multiple pages performance suffers. The SPL kmem cache
allocator was designed to better handle these large allocation
sizes. Therefore, on Linux the kmem_cache_* compatibility wrappers
prefer to use the kernel's slab allocator for small objects and
the custom SPL kmem cache allocator for larger objects.

This logic was effectively disabled for all architectures using
a non-4K page size which caused all kmem caches to only use the
SPL implementation. Functionally this is fine, but the SPL code
which calculates the target number of objects per-slab does not
take in to account that __vmalloc() always returns page-aligned
memory. This can result in a massive amount of wasted space when
allocating tiny objects on a platform using large pages (64k).

To resolve this issue we set the spl_kmem_cache_slab_limit cutoff
to 16K for all architectures. 

This particular change does not attempt to update the logic used
to calculate the optimal number of pages per slab. This remains
an issue which should be addressed in a future change.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12152
Closes #11429
Closes #11574
Closes #12150
2021-06-03 14:37:45 -06:00
..
Makefile.in Add zfs_file_* interface, remove vnodes 2019-11-21 09:32:57 -08:00
README.md Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
THIRDPARTYLICENSE.gplv2 OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
THIRDPARTYLICENSE.gplv2.descrip OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-atomic.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
spl-condvar.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
spl-cred.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
spl-err.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
spl-generic.c linux: don't fall through to 3-arg vfs_getattr 2021-05-26 15:25:34 -07:00
spl-kmem-cache.c Linux: Set spl_kmem_cache_slab_limit when page size !4K 2021-06-03 14:37:45 -06:00
spl-kmem.c kmem_alloc(KM_SLEEP) should use kvmalloc() 2021-04-06 12:44:54 -07:00
spl-kstat.c cppcheck: return value always 0 2021-01-26 16:12:18 -08:00
spl-proc.c linux/spl: proc: use global table_{min,max} values instead of local ones 2021-04-15 14:55:50 -07:00
spl-procfs-list.c Fix buggy procfs_list_seq_next warning 2020-09-30 13:27:51 -07:00
spl-taskq.c cppcheck: remove redundant ASSERTs 2021-01-26 16:12:10 -08:00
spl-thread.c Add SIGSTOP and SIGTSTP handling to issig 2021-04-15 13:34:35 -07:00
spl-trace.c Add tracepoints for taskq entry lifetime events 2019-11-01 13:14:54 -07:00
spl-tsd.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
spl-vmem.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
spl-xdr.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00
spl-zlib.c Replace ZFS on Linux references with OpenZFS 2020-10-08 20:10:13 -07:00

README.md

The Solaris Porting Layer, SPL, is a Linux kernel module which provides a compatibility layer used by the OpenZFS project.

Installation

The latest version of the SPL is maintained as part of this repository. Only when building ZFS version 0.7.x or earlier must an external SPL release be used. These releases can be found at:

Release

The SPL is released under a GPLv2 license.
For more details see the NOTICE and THIRDPARTYLICENSE files; UCRL-CODE-235197