Remove b_pabd/b_rabd allocation from arc_hdr_alloc()
commit6b88b4b501a9e12dd6feee7e3cb2824bc70beeca
authorAlexander Motin <mav@FreeBSD.org>
Tue, 17 Aug 2021 16:15:54 +0000 (17 12:15 -0400)
committerGitHub <noreply@github.com>
Tue, 17 Aug 2021 16:15:54 +0000 (17 10:15 -0600)
tree8dca8b6ea9f1d8ae628a454ec2ead51dcf422f46
parent72f0521abadd77ef06fb1d10c4f4f80af50ec279
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>
Sponsored-By: iXsystems, Inc.
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