HomeFreeBSD

Introduce zfs_refcount_(add|remove)_few().

Description

Introduce zfs_refcount_(add|remove)_few().

There are two places where we need to add/remove several references
with semantics of zfs_refcount_(add|remove). But when debug/tracing
is disabled, it is a crime to run multiple atomic_inc() in a loop,
especially under congested pool-wide allocator lock.

Introduced new functions implement the same semantics as the loop,
but without overhead in production builds.

Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #14934

Details

Provenance
mavAuthored on Jun 5 2023, 6:51 PM
GitHub <noreply@github.com>Committed on Jun 5 2023, 6:51 PM
Parents
rGdae3c549f59a: Linux 6.3 compat: META (#14930)
Branches
Unknown
Tags
Unknown