]> git.proxmox.com Git - mirror_zfs.git/commit
ARC: Remove b_bufcnt/b_ebufcnt from ARC headers
authorAlexander Motin <mav@FreeBSD.org>
Fri, 6 Oct 2023 15:56:17 +0000 (11:56 -0400)
committerGitHub <noreply@github.com>
Fri, 6 Oct 2023 15:56:17 +0000 (08:56 -0700)
commit96b9cf42e0e4b182b1a6969a89dc44391196e59f
tree650e08d0d235b7e0047ac3f9066832c502754981
parent82d2291398398535b461b5851935a67bbd63e5a6
ARC: Remove b_bufcnt/b_ebufcnt from ARC headers

In most cases we do not care about exact number of buffers linked
to the header, we just need to know if it is zero, non-zero or one.
That can easily be checked just looking on b_buf pointer or in some
cases derefencing it.

b_ebufcnt is read only once, and in that case we already traverse
the list as part of arc_buf_remove(), so second traverse should not
be expensive.

This reduces L1 ARC header size by 8 bytes and full crypto header by
16 bytes, down to 176 and 232 bytes on FreeBSD respectively.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15350
include/os/linux/zfs/sys/trace_arc.h
include/sys/arc_impl.h
module/zfs/arc.c