Date: Wed, 5 Jun 2019 00:51:51 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348676 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201906050051.x550pp8A033998@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Wed Jun 5 00:51:51 2019 New Revision: 348676 URL: https://svnweb.freebsd.org/changeset/base/348676 Log: MFC r348117: 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. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed Jun 5 00:08:30 2019 (r348675) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed Jun 5 00:51:51 2019 (r348676) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906050051.x550pp8A033998>