-
Notifications
You must be signed in to change notification settings - Fork 403
[CI-NO-BUILD] [vioscsi] Increase PHYS_SEGMENTS_LIMIT value #1316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[CI-NO-BUILD] [vioscsi] Increase PHYS_SEGMENTS_LIMIT value #1316
Conversation
Changes the PHYS_SEGMENTS_LIMIT to 1,022 equal to QEMU's VIRTQUEUE_MAX_SIZE less 2 (for the CONTROL and EVENT queues). This results in: 1. adaptExt->max_segments = 1022 2. ConfigInfo->NumberOfPhysicalBreaks = 1023 3. ConfigInfo->MaximumTransferLength = 4,088KiB (1,022 * PAGE_SIZE = 4,088KiB) Signed-off-by: benyamin-codez <115509179+benyamin-codez@users.noreply.github.com>
I wouldn't much care to attempt merging this until after the following PRs merge: #1228 Here is a pic showing the VQ Buffer Length and SRB DataTransferLength at the tail end of a 4MiB sequential read: You will observe the transfer is divided into 4,088KiB and 8KiB (4,096KiB = 4MiB) parts. |
Here we can see how |
From PR #1216... I though it best to continue this part here.
Vadim, I think it's worthwhile raising this as a bug / feature request at QEMU. I could have a poke around and maybe come up with a patch, but I think perhaps the QEMU storage team would likely come up with a more timely, considered and permanent solution. This, I imagine would be something more elegant than parsing the output of a simple Being aware of the There's also the pesky In any case, *nix hosts (and maybe *bsd hosts too) presently have a clear advantage because they do not suffer from this limitation. This is not a limitation imposed by StorPort either, but rather by this project. It would be good to get this resolved and Windows hosts back on an "even" footing with the other platforms. EDIT: by *nix, beastie and Windows hosts, I meant VMs... |
From PR #1289... I though it best to continue this part here (even though that one is
Perhaps in the meantime (while you work on IOMMU and DMA v3), those PRs might work well...? |
But that assumes that lets say 4MB transfers are even ideal, yea? Depending on the backing media/storage system, they may want to chunk that down anyhow. In our case, a little inside baseball, our storage system presents a recommended max transfer size of 1MB, and we align segments and such based on that. Furthermore, our vhost-user-scsi aligns preallocations around that, so trying to do something like this //without// the indirect descriptor "advertisements" virtio-spec enhancement that I called out in another review would potentially be a breaking change for non-qemu-managed-datapath-folks (us and I'm sure others). We get around that by wrapping our max breaks in our installer such that it just does the right thing for our platform (for now), but just a FYI on how others in the community use this code. |
Thanks, Jon. I appreciate the insights. I think it's worth pointing out that this is just the max possible value and it does not need to be set this high. Whatever max_segments is set to will determine the MaxXferLen. To make the point: it could be set to just 16 segments and 64Kib transfers like way back at the beginning of StorPort. Also, this maximum will not be realised if no block request is made for the requisite amount. My proposed NoPB-coincident changes will - in the absence of the registry override - default to using whatever is in Usually the MaxXferLen should match the stripe size of the backing, but this would depend on where the host sits in the storage stack. If you have pass-through LUNs with large stripes, this would be an advantage (provided there was sufficiently fast data paths and cache). As for stripe size, the 1MiB you appear to be using is a common value, but I have seen values ranging from as low as 64KiB and up to 8MiB. Notably, if using BusTypeRAID ( Presently, the only way I'm aware of to set MaxXferLen in a StorPort compliant manner is via max_segments * PAGE_SIZE. EDIT: The struck through part is incorrect. I was obtaining the VQ info incorrectly. Please see next posts. As for alternate strategies, I'm a little in the dark (along with most I would imagine) until Vadim releases his work on IOMMU and v3 DMA because AFAIK the DDI for these aren't open. I guess, Vadim's work might make a great deal of sense when we get to see it. Then we have the virtio-spec issue you previously mentioned (oasis-tcs/virtio-spec#122). It was an interesting idea and to me the real value was in the proposed negotiation between device and host as to what the maximum supported values would be. This is much better than just setting it "on paper". I would probably need to thoroughly read the mailing list to get a better understanding of the nuances and fringe cases. Having said that, aren't we effectively already doing some of this without the extra tunables and flags or updates to the standard..? We already regularly exceed the Queue Size whenever max_segments is greater than 126 or 254, e.g. the Anyway, I'm probably not saying anything you don't already know... 8^d I'm currently considering wording for the QEMU bug report and collating some info for that. However, again I think it important to stress that having a MaxXferLen in I'm caught up with some competing priorities over the next few days, so let me have a think about this along the way... |
Per the standard, this will result in the following allocation:
Everyone is very kind here - I'm very rarely pulled up for comments made in error. EDIT: Not only the struck through part, but all of this is incorrect. I was obtaining the VQ info incorrectly. |
However, it looks like
So I presume my trace is using an incorrect VIRTIO_PCI_COMMON_CFG_CAP struct... Checking... EDIT: I was using the incorrect method to get the VQ information in my |
Changes the
PHYS_SEGMENTS_LIMIT
to 1,022 equal to QEMU'sVIRTQUEUE_MAX_SIZE
less 2 (for theCONTROL
andEVENT
queues).This results in:
adaptExt->max_segments
= 1022ConfigInfo->NumberOfPhysicalBreaks
= 1023ConfigInfo->MaximumTransferLength
= 4,088KiB (1,022 * PAGE_SIZE = 4,088KiB)