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>
Closes #12420

Details

Provenance
mavAuthored on Aug 17 2021, 3:44 PM
Tony Hutter <hutter2@llnl.gov>Committed on Sep 14 2021, 9:31 PM
Parents
rGc6c0d30016ff: ZTS: Avoid unset $tmpdir in redacted_panic
Branches
Unknown
Tags
Unknown

Event Timeline