On 5/28/2020 6:08 PM, Laszlo Ersek wrote:
On 05/28/20 18:39, annie li wrote:YupOn 5/27/2020 2:00 PM, Laszlo Ersek wrote:Indeed -- as I just pointed out under your other email, I previouslyThis limits the I/O size to 1M.(4) Annie: can you try launching QEMU with the following flag:
I'm not sure why that happens.Then I found out it is related to operations on this VM, see following.
... Is it possible that vhost_scsi_handle_vq() -- in the host kernel --I ran more tests, and found booting failure happens randomly when I boot the VM
right after it was previously terminated by Ctrl+C directly from QEMU monitor, no
matter the max_sectors is 2048, 16383 or 16384. The failing chance is about 7 out of 20.
So my previous statement about 0x4000 and 0x3FFF isn't accurate.
It is just that booting happened to succeed with 0x3FFF(16383 ), but not with 0x4000(16384).
Also, when this failure happens, dmesg doesn't print out following errors,
vhost_scsi_calc_sgls: requested sgl_count: 2368 exceeds pre-allocated max_sgls: 2048
This new failure is totally different issue from the one caused by max sized I/O. For my
debug log of OVMF, the biggest I/O size is only about 1M. This means Windows 2019
didn't send out big sized I/O out yet.
The interesting part is that I didn't see this new failure happen if I boot the VM which
was previously shutdown gracefully from inside Windows guest.
This involves both changes in kernel and QEMU. I guess maybe it is more straightWith vhost, the virtio-scsi device model is split between QEMU and theYou mean the vhost device on the guest side here, right? In WindowsIf that works, then I *guess* the kernel-side vhost device model
that kernel controls the transfer size based on memory consumed.
I prefer to fixing it by using larger constants in the kernel, this also avoid splitting
big sized I/O by using smaller "max_sectors"default in QEMU.
Following is the code change I did in the kernel code vhost/scsi.c,
-#define VHOST_SCSI_PREALLOC_SGLS 2048
-#define VHOST_SCSI_PREALLOC_UPAGES 2048
+#define VHOST_SCSI_PREALLOC_SGLS 2560
+#define VHOST_SCSI_PREALLOC_UPAGES 2560