mirror_zfs/module/spl
Serapheim Dimitropoulos 8c8f84472b 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
2020-01-22 13:49:03 -08:00
..
Makefile.in Retire unused spl_{mutex,rwlock}_{init_fini} 2019-09-25 11:27:49 -07:00
README.md Update build system and packaging 2018-05-29 16:00:33 -07:00
spl-atomic.c Fix cstyle warnings 2018-02-07 11:49:38 -08:00
spl-condvar.c Fix typos in module/ 2020-01-22 13:48:59 -08:00
spl-cred.c Fix cstyle warnings 2018-02-07 11:49:38 -08:00
spl-err.c Correct snprintf() size argument 2019-04-30 19:41:12 -07:00
spl-generic.c Fix typos in module/ 2020-01-22 13:48:59 -08:00
spl-kmem-cache.c Update skc_obj_alloc for spl kmem caches that are backed by Linux 2020-01-22 13:49:03 -08:00
spl-kmem.c Add missing __GFP_HIGHMEM flag to vmalloc 2019-09-25 11:27:49 -07:00
spl-kobj.c Fix cstyle warnings 2018-02-07 11:49:38 -08:00
spl-kstat.c Unbreak build on Linux kernel < 3.10 2019-04-08 14:59:24 -07:00
spl-proc.c Update skc_obj_alloc for spl kmem caches that are backed by Linux 2020-01-22 13:49:03 -08:00
spl-procfs-list.c Restrict kstats and print real pointers 2019-04-04 18:57:06 -07:00
spl-taskq.c kernel timer API rework 2019-09-25 11:27:46 -07:00
spl-thread.c Minor style cleanup 2019-09-25 11:27:49 -07:00
spl-tsd.c Fix typos in module/ 2020-01-22 13:48:59 -08:00
spl-vmem.c Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
spl-vnode.c Remove vn_set_fs_pwd()/vn_set_pwd() (no need to be at / during insmod) 2019-09-25 11:27:46 -07:00
spl-xdr.c Update build system and packaging 2018-05-29 16:00:33 -07:00
spl-zlib.c Drop KMC_NOEMERGENCY 2020-01-22 13:48:57 -08:00
THIRDPARTYLICENSE.gplv2 Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
THIRDPARTYLICENSE.gplv2.descrip Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -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