* [Qemu-devel] trim in windows guest witch virtio
@ 2013-07-23 1:05 Libaiqing
2013-07-23 6:34 ` Paolo Bonzini
0 siblings, 1 reply; 6+ messages in thread
From: Libaiqing @ 2013-07-23 1:05 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel@nongnu.org
Hi paolo,
Recently I test trim function,and it works well in linux guest with ext4 fs.
How to test it in windows guest? I got some info like this:
1 windows7 can send discard command when the storage device is ssd;
2 find a tool like 'fstrim', 'TRIM' the volume manually.
What's your opinion about this.
Thanks
Baiqing.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] trim in windows guest witch virtio
2013-07-23 1:05 [Qemu-devel] trim in windows guest witch virtio Libaiqing
@ 2013-07-23 6:34 ` Paolo Bonzini
2013-07-24 0:53 ` Libaiqing
0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2013-07-23 6:34 UTC (permalink / raw)
To: Libaiqing; +Cc: qemu-devel@nongnu.org
Il 23/07/2013 03:05, Libaiqing ha scritto:
> Hi paolo,
> Recently I test trim function,and it works well in linux guest with ext4 fs.
>
> How to test it in windows guest? I got some info like this:
> 1 windows7 can send discard command when the storage device is ssd;
> 2 find a tool like 'fstrim', 'TRIM' the volume manually.
I think it only works with IDE and AHCI on Windows. You need a filter
driver to send it on SCSI disks.
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] trim in windows guest witch virtio
2013-07-23 6:34 ` Paolo Bonzini
@ 2013-07-24 0:53 ` Libaiqing
2013-07-24 6:45 ` Paolo Bonzini
0 siblings, 1 reply; 6+ messages in thread
From: Libaiqing @ 2013-07-24 0:53 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel@nongnu.org
Hi paolo,
I test window guest with ide device with the following config,trim with ide drive failed.
1 The host fs is ext4 with discard option:
/dev/sdb1 on /home/sdb type ext4 (rw,relatime,discard,data=ordered)
2 qemu config : ide drive with discard open
x86_64-softmmu/qemu-system-x86_64 -enable-kvm -name win7 -M pc-0.15 -m 1024 -smp 2 -boot c -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/home/win7_base.qcow2,if=ide,index=0,format=qcow2,id=ad -drive file=/home/sdb/raw.img,if=ide,index=1,format=raw,id=hd,discard=on -monitor stdio -vga qxl -vnc :1 -device usb-tablet,id=input0
3 In win7 guest,init drive d,fill it with files,then shift+del files
4 The file /home/sdb/raw.img does not become small,when listing with -s option.
It seems that the windows ntfs does not send trim to ide controller. No IDE_DMA_TRIM request received.
Is there any config wrong?
Btw,I found the info from the URL: http://msdn.microsoft.com/en-us/library/windows/desktop/hh848053(v=vs.85).aspx
Qemu can do the same thing like hyper-v with windows guest?
Thanks
baiqing
> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> Sent: Tuesday, July 23, 2013 2:35 PM
> To: Libaiqing
> Cc: qemu-devel@nongnu.org
> Subject: Re: trim in windows guest witch virtio
>
> Il 23/07/2013 03:05, Libaiqing ha scritto:
> > Hi paolo,
> > Recently I test trim function,and it works well in linux guest with ext4
> fs.
> >
> > How to test it in windows guest? I got some info like this:
> > 1 windows7 can send discard command when the storage device is
> ssd;
> > 2 find a tool like 'fstrim', 'TRIM' the volume manually.
>
> I think it only works with IDE and AHCI on Windows. You need a filter
> driver to send it on SCSI disks.
>
> Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] trim in windows guest witch virtio
2013-07-24 0:53 ` Libaiqing
@ 2013-07-24 6:45 ` Paolo Bonzini
2013-07-24 7:52 ` Libaiqing
0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2013-07-24 6:45 UTC (permalink / raw)
To: Libaiqing; +Cc: qemu-devel@nongnu.org
Il 24/07/2013 02:53, Libaiqing ha scritto:
> Hi paolo,
>
> I test window guest with ide device with the following config,trim with ide drive failed.
>
> 1 The host fs is ext4 with discard option:
> /dev/sdb1 on /home/sdb type ext4 (rw,relatime,discard,data=ordered)
>
> 2 qemu config : ide drive with discard open
> x86_64-softmmu/qemu-system-x86_64 -enable-kvm -name win7 -M pc-0.15 -m 1024 -smp 2 -boot c -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/home/win7_base.qcow2,if=ide,index=0,format=qcow2,id=ad -drive file=/home/sdb/raw.img,if=ide,index=1,format=raw,id=hd,discard=on -monitor stdio -vga qxl -vnc :1 -device usb-tablet,id=input0
TRIM is supported only on "-M pc-1.5" and "-M pc".
> 3 In win7 guest,init drive d,fill it with files,then shift+del files
>
> 4 The file /home/sdb/raw.img does not become small,when listing with -s option.
>
> It seems that the windows ntfs does not send trim to ide controller. No IDE_DMA_TRIM request received.
Note that this may not happen immediately. NTFS may send TRIM later.
> Is there any config wrong?
>
> Btw,I found the info from the URL: http://msdn.microsoft.com/en-us/library/windows/desktop/hh848053(v=vs.85).aspx
> Qemu can do the same thing like hyper-v with windows guest?
I don't know, I never tested it with Windows guests. It looks like
Windows 8 would not need a filter driver to do TRIM on SCSI disks (you
could try with megasas, so that you do not need a driver for the HBA).
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] trim in windows guest witch virtio
2013-07-24 6:45 ` Paolo Bonzini
@ 2013-07-24 7:52 ` Libaiqing
2013-07-24 7:57 ` Paolo Bonzini
0 siblings, 1 reply; 6+ messages in thread
From: Libaiqing @ 2013-07-24 7:52 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel@nongnu.org
Hi paolo,
With -M pc,trim works well in windows guest with ide device and ahci bus.
About the filter driver,you mean do something in windows virtio-scsi driver,let it send unmap command to qemu?
Thanks
baiqing.
> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> Sent: Wednesday, July 24, 2013 2:46 PM
> To: Libaiqing
> Cc: qemu-devel@nongnu.org
> Subject: Re: trim in windows guest witch virtio
>
> Il 24/07/2013 02:53, Libaiqing ha scritto:
> > Hi paolo,
> >
> > I test window guest with ide device with the following config,trim
> with ide drive failed.
> >
> > 1 The host fs is ext4 with discard option:
> > /dev/sdb1 on /home/sdb type ext4
> (rw,relatime,discard,data=ordered)
> >
> > 2 qemu config : ide drive with discard open
> > x86_64-softmmu/qemu-system-x86_64 -enable-kvm -name win7 -M
> pc-0.15 -m 1024 -smp 2 -boot c -device
> piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive
> file=/home/win7_base.qcow2,if=ide,index=0,format=qcow2,id=ad -drive
> file=/home/sdb/raw.img,if=ide,index=1,format=raw,id=hd,discard=on
> -monitor stdio -vga qxl -vnc :1 -device usb-tablet,id=input0
>
> TRIM is supported only on "-M pc-1.5" and "-M pc".
>
> > 3 In win7 guest,init drive d,fill it with files,then shift+del files
> >
> > 4 The file /home/sdb/raw.img does not become small,when listing
> with -s option.
> >
> > It seems that the windows ntfs does not send trim to ide controller.
> No IDE_DMA_TRIM request received.
>
> Note that this may not happen immediately. NTFS may send TRIM later.
>
> > Is there any config wrong?
> >
> > Btw,I found the info from the URL:
> http://msdn.microsoft.com/en-us/library/windows/desktop/hh848053(v=vs.
> 85).aspx
> > Qemu can do the same thing like hyper-v with windows guest?
>
> I don't know, I never tested it with Windows guests. It looks like
> Windows 8 would not need a filter driver to do TRIM on SCSI disks (you
> could try with megasas, so that you do not need a driver for the HBA).
>
> Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] trim in windows guest witch virtio
2013-07-24 7:52 ` Libaiqing
@ 2013-07-24 7:57 ` Paolo Bonzini
0 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2013-07-24 7:57 UTC (permalink / raw)
To: Libaiqing; +Cc: qemu-devel@nongnu.org
Il 24/07/2013 09:52, Libaiqing ha scritto:
> Hi paolo,
> With -M pc,trim works well in windows guest with ide device and ahci bus.
>
> About the filter driver,you mean do something in windows virtio-scsi driver,let it send unmap command to qemu?
Yes, it must trap the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES ioctl and
convert it to a SCSI UNMAP command. But your link may suggest that it's
only needed on Windows < 8 (and Server < 2012).
Paolo
> Thanks
> baiqing.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-07-24 7:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-23 1:05 [Qemu-devel] trim in windows guest witch virtio Libaiqing
2013-07-23 6:34 ` Paolo Bonzini
2013-07-24 0:53 ` Libaiqing
2013-07-24 6:45 ` Paolo Bonzini
2013-07-24 7:52 ` Libaiqing
2013-07-24 7:57 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).