Page MenuHomeFreeBSD

hyperv/stor: Use xpt_done_direct() whenever possible
ClosedPublic

Authored by sepherosa_gmail.com on Apr 15 2016, 6:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 23 2024, 1:53 AM
Unknown Object (File)
Mar 19 2024, 11:31 PM
Unknown Object (File)
Mar 19 2024, 7:52 PM
Unknown Object (File)
Feb 8 2024, 4:50 PM
Unknown Object (File)
Dec 30 2023, 3:23 AM
Unknown Object (File)
Dec 20 2023, 1:38 AM
Unknown Object (File)
Nov 22 2023, 9:05 AM
Unknown Object (File)
Nov 7 2023, 11:15 AM
Subscribers
None

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sepherosa_gmail.com retitled this revision from to hyperv/stor: Use xpt_done_direct() whenever possible.
sepherosa_gmail.com updated this object.
sepherosa_gmail.com edited the test plan for this revision. (Show Details)

I see no problems from using direct completion here. Its efficiency may vary, depending on number of disks and interrupts per controller. On real hardware with many disks per controller and only one interrupt I sometimes could get higher parallel IOPS when used queued completion due to using multiple completion threads in CAM. Direct completion is the most efficient on HBAs with multiple interrupt vectors or with only one/few disks connected. Though VM may have very different performance characteristics to optimize for.

I am just not sure why is there XPT_FC_QUEUED check? Both xpt_done(ccb) and xpt_done_direct(ccb) actually just return immediately if they see this flag, so this condition is effectively a NOP. Also I doubt any non-queued requests are going that path any way, since I don't see cases when this code path would be called not form interrupt handler.

In D5955#126973, @mav wrote:

I see no problems from using direct completion here. Its efficiency may vary, depending on number of disks and interrupts per controller. On real hardware with many disks per controller and only one interrupt I sometimes could get higher parallel IOPS when used queued completion due to using multiple completion threads in CAM. Direct completion is the most efficient on HBAs with multiple interrupt vectors or with only one/few disks connected. Though VM may have very different performance characteristics to optimize for.

Mainly to avoid extra schedule, which could introduce potential latency on io done path. And this driver is using "multiple interrupts".

I am just not sure why is there XPT_FC_QUEUED check? Both xpt_done(ccb) and xpt_done_direct(ccb) actually just return immediately if they see this flag, so this condition is effectively a NOP. Also I doubt any non-queued requests are going that path any way, since I don't see cases when this code path would be called not form interrupt handler.

Hmm, I copied it from ahci bindly. I didn't see the reason why it should be checked in either ahci or here either. Maybe for some historical reasons?

Hmm, I copied it from ahci bindly. I didn't see the reason why it should be checked in either ahci or here either. Maybe for some historical reasons?

In AHCI situation is different. ahci_done() is called from both request and response contexts, and also indeed called for non-queued requests too, in which case doing extra work for direct completion (which is any way NOP) is pointless.

I think you should remove the check. After that it would be good for me.

In D5955#126996, @mav wrote:

Hmm, I copied it from ahci bindly. I didn't see the reason why it should be checked in either ahci or here either. Maybe for some historical reasons?

In AHCI situation is different. ahci_done() is called from both request and response contexts, and also indeed called for non-queued requests too, in which case doing extra work for direct completion (which is any way NOP) is pointless.

Aha, I see. Thanks!

I think you should remove the check. After that it would be good for me.

sepherosa_gmail.com edited edge metadata.

No need to check FC_QUEUED. Suggested by mav

In D5955#126996, @mav wrote:

Hmm, I copied it from ahci bindly. I didn't see the reason why it should be checked in either ahci or here either. Maybe for some historical reasons?

In AHCI situation is different. ahci_done() is called from both request and response contexts, and also indeed called for non-queued requests too, in which case doing extra work for direct completion (which is any way NOP) is pointless.

I think you should remove the check. After that it would be good for me.

Done. Thank you for the clarification and suggestion!

mav edited edge metadata.
This revision is now accepted and ready to land.Apr 15 2016, 7:13 AM
This revision was automatically updated to reflect the committed changes.