Page MenuHomeFreeBSD

nvme: Reduce traffic to the doorbell register
ClosedPublic

Authored by imp on Tue, Oct 12, 8:36 PM.

Details

Summary

Reduce traffic to doorbell register when processing multiple completion
events at once. Only write it at the end of the loop after we've
processed everything (assuming we found at least one completion).

Sponsored by: Netflix

Test Plan

"boots for me"

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

imp requested review of this revision.Tue, Oct 12, 8:36 PM
imp added reviewers: chuck, mav.
sys/dev/nvme/nvme_qpair.c
668

It seems cq_head can be incremented above without done incremented and without panic on non-debug kernel, in which case the register won't be written, while I think it should unless we want to get back here again.

sys/dev/nvme/nvme_qpair.c
635–636

I'll move this up a few lines.... though I'm thinking of making this a 'panic', but maybe not yet.

If we 'accept' it, then bump the count of items we've cleared.

imp marked an inline comment as done.
imp added inline comments.
sys/dev/nvme/nvme_qpair.c
668

Good catch. Fixed.

This revision is now accepted and ready to land.Wed, Oct 13, 6:34 PM
This revision was automatically updated to reflect the committed changes.
imp marked an inline comment as done.