HomeFreeBSD

Use more atomics in refcounts

Description

Use more atomics in refcounts

Use atomic_load_64() for zfs_refcount_count() to prevent torn reads
on 32-bit platforms. On 64-bit ones it should not change anything.

When built with ZFS_DEBUG but running without tracking enabled use
atomics instead of mutexes same as for builds without ZFS_DEBUG.
Since rc_tracked can't change live we can check it without lock.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12420

Details

Provenance
mavAuthored on Aug 17 2021, 3:44 PM
GitHub <noreply@github.com>Committed on Aug 17 2021, 3:44 PM
Parents
rG5bfc3a99f93d: ZTS: Avoid unset $tmpdir in redacted_panic
Branches
Unknown
Tags
Unknown

Event Timeline