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)
Thu, Nov 14, 5:30 PM
Unknown Object (File)
Wed, Nov 13, 1:46 AM
Unknown Object (File)
Wed, Nov 6, 5:04 PM
Unknown Object (File)
Wed, Nov 6, 5:04 PM
Unknown Object (File)
Wed, Nov 6, 4:45 PM
Unknown Object (File)
Wed, Oct 23, 11:42 AM
Unknown Object (File)
Mon, Oct 21, 12:46 AM
Unknown Object (File)
Sun, Oct 20, 5:13 PM
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 58729
Build 55617: 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.