diff options
author | Alexander Motin <mav@FreeBSD.org> | 2019-05-22 18:43:48 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2019-05-22 18:43:48 +0000 |
commit | 83d0c3846d6b7ed73e813db296eac3e42004dd07 (patch) | |
tree | 338dcc6bd853011331cb01154d28f54c6061c0cd /sys/cddl/contrib/opensolaris/uts/common | |
parent | 1895f5202a715852c8a0bf11422b5b387b131221 (diff) | |
download | src-83d0c3846d6b7ed73e813db296eac3e42004dd07.tar.gz src-83d0c3846d6b7ed73e813db296eac3e42004dd07.zip |
Allocate buffers smaller then ABD chunk size as linear.
This allows to reduce memory waste by letting UMA to put multiple small
buffers into one memory page slab. The page sharing means that UMA
may not be able to free memory page when some of buffers are freed, but
alternatively memory used by that buffer would just be wasted from the
beginning.
This change follows alike change in ZoL, but unlike Linux (according to
my understanding of it from comments) FreeBSD never shares slabs bigger
then one memory page, so this should be even less invasive then there.
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
Notes
Notes:
svn path=/head/; revision=348117
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c index f6e4a92dd4c2..3730d53f5eb4 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c @@ -290,7 +290,7 @@ abd_free_struct(abd_t *abd) abd_t * abd_alloc(size_t size, boolean_t is_metadata) { - if (!zfs_abd_scatter_enabled) + if (!zfs_abd_scatter_enabled || size <= zfs_abd_chunk_size) return (abd_alloc_linear(size, is_metadata)); VERIFY3U(size, <=, SPA_MAXBLOCKSIZE); |