zfs/module/os/linux/spl
Brian Behlendorf f14b6f2302 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-23 13:22:15 -07: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-16 13:01:24 -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-16 13:01:24 -07:00
spl-condvar.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -07:00
spl-cred.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -07:00
spl-err.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -07:00
spl-generic.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -07:00
spl-kmem-cache.c Linux: Set spl_kmem_cache_slab_limit when page size !4K 2021-06-23 13:22:15 -07:00
spl-kmem.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -07:00
spl-kstat.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -07:00
spl-proc.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -07:00
spl-procfs-list.c Fix buggy procfs_list_seq_next warning 2020-10-01 12:30:28 -07:00
spl-taskq.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -07:00
spl-thread.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -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-16 13:01:24 -07:00
spl-vmem.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -07:00
spl-xdr.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -07:00
spl-zlib.c Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -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