Page MenuHomeFreeBSD

nvme: Optimize timeout code further
ClosedPublic

Authored by imp on Jul 18 2024, 6:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 11, 4:49 AM
Unknown Object (File)
Sat, Oct 5, 10:51 PM
Unknown Object (File)
Sat, Oct 5, 10:54 AM
Unknown Object (File)
Thu, Oct 3, 12:57 AM
Unknown Object (File)
Wed, Oct 2, 8:07 PM
Unknown Object (File)
Wed, Oct 2, 8:06 PM
Unknown Object (File)
Wed, Oct 2, 7:22 AM
Unknown Object (File)
Wed, Oct 2, 1:11 AM
Subscribers

Details

Summary

Optimize timeout code based on three observations.

(1) The tr queues are sorted in order of submission, so the first one

that could time out is the first "real" one on the list.

(2) Timeouts for a given queue are all the same length (well, except

at startup, where timeout doesn't matter, and when you change it
at runtime, where timeouts will still happen eventually and the
difference isn't worth optimizing for).

(3) Calling the ISR races the real ISR and we should avoid that better.

So now, after checking to see if the card is there and working, the
timeout routine scans the pending tracker list until it finds a non-AER
tracker. If the deadline hasn't passed, we return, doing nothing
further. Otherwise, we call poll completions and then process the list
looking for timed out items.

This should move the timeout routine to touching hardware only when it's
really necessary. It thus avoids racing the normal ISR, while still
timig out stuck transactions quickly enough.

There was also some minor code motion to make all of the above flow more
nicely for the reader.

When interrupts aren't working at all, then this will increase latency
somewhat. But when interrupts aren't working at all, there's bigger
problems and we should poll quite often in that case. That will be
handled in future commits.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58708
Build 55596: arc lint + arc unit

Event Timeline

imp requested review of this revision.Jul 18 2024, 6:12 PM
imp planned changes to this revision.Jul 18 2024, 7:16 PM

Talking to Drew, he suggested a nice simplification that I'll do and then I'll post an updated review.

OK. In the spirit of doing just one thing at a time, this just handles stuck I/O, but not missing timeouts. There's a simpler way to do that than the first rev of this.

Misc updates with testing

This revision was not accepted when it landed; it landed in state Needs Review.Jul 23 2024, 11:04 PM
This revision was automatically updated to reflect the committed changes.