HomeFreeBSD

Switch from mutexes to atomics in GEOM_DEV I/O path.

Description

Switch from mutexes to atomics in GEOM_DEV I/O path.

Mutexes in I/O path there were used twice per I/O to atomically access
several variables to close and/or destroy the device on last request
completion. I found the way to fit all required info into one integer,
suitable for atomic operations. It opened race window on device close,
but addition of timeout to the msleep() there should cover it.

Profiling shows removal of significant spinning time on those mutexes
and IOPS increase from ~600K to >800K to NVMe on 72-core systems.

MFC after: 1 month
Sponsored by: iXsystems, Inc.

Details

Provenance
mavAuthored on
Parents
rS342557: Reimplement nvd(4) detach handling.
Branches
Unknown
Tags
Unknown