Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Xen: Users

Trim support for domU

 

 

Xen users RSS feed   Index | Next | Previous | View Threaded


xieliwei at gmail

Jul 8, 2012, 8:25 PM

Post #1 of 4 (347 views)
Permalink
Trim support for domU

Hi list,
Recently we've been thinking of adding SSDs into some of our domU
VMs to boost application loading times. Looking around, it seems that
information about trim support in various configurations is sparse at
best.
The only clear confirmation I could find is that trim is supported
in PV domU on Linux kernels 3.1 and above, but only if dom0 has kernel
3.1 and above as well.
So paravirtualised Linux domUs are fine for the upgrade, but what
about other configurations?
1. Non-PV Linux domUs?
2. Non-PV BSD domUs?
3. PV BSD domUs?
4. Windows domUs?
5. Windows domUs with PV drivers?
6. Other non-PV configurations?
Perhaps it'd be great to clear everything up now.

_______________________________________________
Xen-users mailing list
Xen-users [at] lists
http://lists.xen.org/xen-users


cdelorme at gmail

Jul 8, 2012, 8:42 PM

Post #2 of 4 (334 views)
Permalink
Re: Trim support for domU [In reply to]

I have been using a SSD with Xen 4.2 for 6 months. I am running on Debian
Wheezy Dom0, and a compiled Kernel 3.4.4.

Trim required not only the appropriate kernel, but the discard flag in
fstab, and only for compatible file systems (Ext4 being one).

My SSD has /boot/efi and /boot partitions, the rest is LVM, and I have Ext4
for my /home and / (root) partitions with discard flag added manually to
/etc/fstab. This appears to be working.

For virtual machines I have an HVM Windows which without GPLPV drivers
appears to have recognized that it was running on a SSD (well a LV on an
SSD), as it had Auto Disk Defrag turned off. So HVM Windows appears to
support trim.

I have been running a Debian Squeeze HVM DomU for web development testing,
and for stability I had not added trim. I also have been running a pfSense
HVM DomU (FreeBSD) but I have not checked whether it supports trim either.


On Sun, Jul 8, 2012 at 11:25 PM, Liwei <xieliwei [at] gmail> wrote:

> Hi list,
> Recently we've been thinking of adding SSDs into some of our domU
> VMs to boost application loading times. Looking around, it seems that
> information about trim support in various configurations is sparse at
> best.
> The only clear confirmation I could find is that trim is supported
> in PV domU on Linux kernels 3.1 and above, but only if dom0 has kernel
> 3.1 and above as well.
> So paravirtualised Linux domUs are fine for the upgrade, but what
> about other configurations?
> 1. Non-PV Linux domUs?
> 2. Non-PV BSD domUs?
> 3. PV BSD domUs?
> 4. Windows domUs?
> 5. Windows domUs with PV drivers?
> 6. Other non-PV configurations?
> Perhaps it'd be great to clear everything up now.
>
> _______________________________________________
> Xen-users mailing list
> Xen-users [at] lists
> http://lists.xen.org/xen-users
>


xieliwei at gmail

Jul 8, 2012, 10:51 PM

Post #3 of 4 (325 views)
Permalink
Re: Trim support for domU [In reply to]

On 9 July 2012 11:42, Casey DeLorme <cdelorme [at] gmail> wrote:
> I have been using a SSD with Xen 4.2 for 6 months. I am running on Debian
> Wheezy Dom0, and a compiled Kernel 3.4.4.
>
> Trim required not only the appropriate kernel, but the discard flag in
> fstab, and only for compatible file systems (Ext4 being one).
>
> My SSD has /boot/efi and /boot partitions, the rest is LVM, and I have Ext4
> for my /home and / (root) partitions with discard flag added manually to
> /etc/fstab. This appears to be working.
>
> For virtual machines I have an HVM Windows which without GPLPV drivers
> appears to have recognized that it was running on a SSD (well a LV on an
> SSD), as it had Auto Disk Defrag turned off. So HVM Windows appears to
> support trim.
>
> I have been running a Debian Squeeze HVM DomU for web development testing,
> and for stability I had not added trim. I also have been running a pfSense
> HVM DomU (FreeBSD) but I have not checked whether it supports trim either.
>

Thanks for the reply, it sure increases the optimism in me! I'll give
it a try with today's xen-unstable and mainline kernel.

However, can any dev clarify how trim could work on non-PV machines,
and even on LVM? My original impression was that it'd only be remotely
possible by passing in the whole SSD, but Casey seems to have it
working on a LVM volume on an SSD. Thanks!

_______________________________________________
Xen-users mailing list
Xen-users [at] lists
http://lists.xen.org/xen-users


astralstorm at gmail

Jul 9, 2012, 12:40 AM

Post #4 of 4 (325 views)
Permalink
Re: Trim support for domU [In reply to]

On Mon, Jul 9, 2012 at 7:51 AM, Liwei <xieliwei [at] gmail> wrote:
> However, can any dev clarify how trim could work on non-PV machines,
> and even on LVM? My original impression was that it'd only be remotely
> possible by passing in the whole SSD, but Casey seems to have it
> working on a LVM volume on an SSD. Thanks!

LVM supports TRIM reasonably well since I think 2.6.28. However it
will reduce the efficiency of trimming, since the Physical Volume
slice size is typically single megabytes.
I'm also not certain whether it supports TRIM in its RAID setups,
would have to check the code.

I don't know if blktap2 supports TRIM - or any Linux filesystem for
single file modifications for that matter, even if the file is sparse
- and blktap2 works via the filesystem's AIO/O_DIRECT interfaces.
However you could always try copying the image in sparse mode and
remove the original. (cp --sparse=always)

--
Radosław Szkodziński

_______________________________________________
Xen-users mailing list
Xen-users [at] lists
http://lists.xen.org/xen-users

Xen users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.