mirror_zfs/module/os/linux/spl
Serapheim Dimitropoulos 851eda3566 Update skc_obj_alloc for spl kmem caches that are backed by Linux
Currently, for certain sizes and classes of allocations we use
SPL caches that are backed by caches in the Linux Slab allocator
to reduce fragmentation and increase utilization of memory. The
way things are implemented for these caches as of now though is
that we don't keep any statistics of the allocations that we
make from these caches.

This patch enables the tracking of allocated objects in those
SPL caches by making the trade-off of grabbing the cache lock
at every object allocation and free to update the respective
counter.

Additionally, this patch makes those caches visible in the
/proc/spl/kmem/slab special file.

As a side note, enabling the specific counter for those caches
enables SDB to create a more user-friendly interface than
/proc/spl/kmem/slab that can also cross-reference data from
slabinfo. Here is for example the output of one of those
caches in SDB that outputs the name of the underlying Linux
cache, the memory of SPL objects allocated in that cache,
and the percentage of those objects compared to all the
objects in it:
```
> spl_kmem_caches | filter obj.skc_name == "zio_buf_512" | pp
name        ...            source total_memory util
----------- ... ----------------- ------------ ----
zio_buf_512 ... kmalloc-512[SLUB]       16.9MB    8
```

Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #9474
2019-10-18 13:24:28 -04:00
..
Makefile.in OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
README.md OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-atomic.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-condvar.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-cred.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-err.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-generic.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-kmem-cache.c Update skc_obj_alloc for spl kmem caches that are backed by Linux 2019-10-18 13:24:28 -04:00
spl-kmem.c Fix strdup conflict on other platforms 2019-10-10 09:47:06 -07:00
spl-kobj.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-kstat.c Fix strdup conflict on other platforms 2019-10-10 09:47:06 -07:00
spl-proc.c Update skc_obj_alloc for spl kmem caches that are backed by Linux 2019-10-18 13:24:28 -04:00
spl-procfs-list.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-taskq.c Fix strdup conflict on other platforms 2019-10-10 09:47:06 -07:00
spl-thread.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-tsd.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-vmem.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-vnode.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-xdr.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
spl-zlib.c OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -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

The Solaris Porting Layer, SPL, is a Linux kernel module which provides a compatibility layer used by the ZFS on Linux 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