HomeFreeBSD

nvme: Use adaptive spinning when polling for completion or state change

Description

nvme: Use adaptive spinning when polling for completion or state change

We only use nvme_completion_poll in the initialization path. The
commands they queue and wait for finish quickly as they involve no I/O
to the drive's media. These command take about 20-200 microsecnds
each. Set the wait time to 1us and then increase it by 1.5 each
successive iteration (max 1ms). This reduces initialization time by
80ms in cpervica's tests.

Use this same technique waiting for RDY state transitions. This saves
another 20ms. In total we're down from ~330ms to ~2ms.

Tested by: cperciva
Sponsored by: Netflix
Reviewed by: mav
Differential Review: https://reviews.freebsd.org/D32259

Details

Provenance
impAuthored on Oct 1 2021, 5:32 PM
Parents
rGef7d2c1fc160: nfs: eliminate thread argument from nfsvno_namei
Branches
Unknown
Tags
Unknown