]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Remove b_pabd/b_rabd allocation from arc_hdr_alloc()
authorAlexander Motin <mav@FreeBSD.org>
Tue, 17 Aug 2021 16:15:54 +0000 (12:15 -0400)
committerTony Hutter <hutter2@llnl.gov>
Tue, 14 Sep 2021 21:31:50 +0000 (14:31 -0700)
commita4862125b887c4b9f6bc3889119ef030da5a4248
tree529643fc7e6c1879c0d9c959b0bcb7eea808a966
parent61773f41b898a53e8af0f4c242764d74fa2be55c
Remove b_pabd/b_rabd allocation from arc_hdr_alloc()

When a header is allocated for full overwrite it is a waste of time
to allocate b_pabd/b_rabd for it, since arc_write() will free them
without ever being touched.  If it is a read or a partial overwrite
then arc_read() and arc_hdr_decrypt() allocate them explicitly.

Reduced memory allocation in user threads also reduces ARC eviction
throttling there, proportionally increasing it in ZIO threads, that
is not good.  To minimize or even avoid it introduce ARC allocation
reserve, allowing certain arc_get_data_abd() callers to allocate a
bit longer in situations where user threads will already throttle.

Reviewed-by: George Wilson <gwilson@delphix.com>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Closes #12398
include/sys/arc_impl.h
module/os/freebsd/zfs/arc_os.c
module/os/linux/zfs/arc_os.c
module/zfs/arc.c