* [linux-lvm] LVM thin pool discard_max_bytes reports 0
@ 2014-08-07 3:48 Timur Alperovich
2014-08-07 5:03 ` Timur Alperovich
0 siblings, 1 reply; 3+ messages in thread
From: Timur Alperovich @ 2014-08-07 3:48 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]
Hi there,
I was trying to understand why fstrim would fail on an LVM thin provisioned
volume and figured out that the discard_max_bytes is reported as 0 in
/sys/block/dm-N/queue/discard_max_bytes (I checked the device that
corresponded to the LVM pool that the volume is created within). The
discard options are also disabled for the thin volume itself. I'm observing
this issue on an Ubuntu 12.04 system, running kernel 3.8.0-32, and LVM2
2.02.98 backported to Ubuntu 12.04 (
https://launchpad.net/~timur-alperovich/+archive/ubuntu/ppa/+packages).
I did a small experiment where I created another LVM pool within the same
volume group and the discard value was set to 65536 for that device. I'm
not sure if it matters, but the system is an running on ESXi 5.0 host.
While I don't necessarily expect discard to propagate to the host, I was
hoping to reclaim the block in the thin pool itself.
Could anyone shed some light on why discard may be disabled on an LVM thin
pool device? I tried looking for any bugs specific to TRIM or discard
subsequent to 2.02.98, but could not find anything definitive.
Also, is there a way to enable discard without having to recreate the thin
pool?
Thank you,
Timur
[-- Attachment #2: Type: text/html, Size: 1457 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] LVM thin pool discard_max_bytes reports 0
2014-08-07 3:48 [linux-lvm] LVM thin pool discard_max_bytes reports 0 Timur Alperovich
@ 2014-08-07 5:03 ` Timur Alperovich
2014-08-07 7:57 ` Zdenek Kabelac
0 siblings, 1 reply; 3+ messages in thread
From: Timur Alperovich @ 2014-08-07 5:03 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 1959 bytes --]
I have managed to answer my own questions.
On Wed, Aug 6, 2014 at 8:48 PM, Timur Alperovich <timur@maginatics.com>
wrote:
> Hi there,
>
> I was trying to understand why fstrim would fail on an LVM thin
> provisioned volume and figured out that the discard_max_bytes is reported
> as 0 in /sys/block/dm-N/queue/discard_max_bytes (I checked the device that
> corresponded to the LVM pool that the volume is created within). The
> discard options are also disabled for the thin volume itself. I'm observing
> this issue on an Ubuntu 12.04 system, running kernel 3.8.0-32, and LVM2
> 2.02.98 backported to Ubuntu 12.04 (
> https://launchpad.net/~timur-alperovich/+archive/ubuntu/ppa/+packages).
>
> I did a small experiment where I created another LVM pool within the same
> volume group and the discard value was set to 65536 for that device. I'm
> not sure if it matters, but the system is an running on ESXi 5.0 host.
> While I don't necessarily expect discard to propagate to the host, I was
> hoping to reclaim the block in the thin pool itself.
>
> Could anyone shed some light on why discard may be disabled on an LVM thin
> pool device? I tried looking for any bugs specific to TRIM or discard
> subsequent to 2.02.98, but could not find anything definitive.
>
I noticed the following in the 2.02.98 changelog:
"Reinstate correct default to ignore discards for thin metadata from old
tools."
and this looks like the associated commit:
commit 109b3bb49b31d5fa7f6d0dd23345d703ab866ad6
Author: Zdenek Kabelac <zkabelac@redhat.com>
Date: Tue Aug 21 15:51:54 2012 +0200
thin: discard
The commit changes the default discard value to "ignore" and this can be
confirmed with lvs -o +discards
> Also, is there a way to enable discard without having to recreate the thin
> pool?
>
Yes, it can be changed with lvchange --discards passdown (being mindful of
https://bugzilla.redhat.com/show_bug.cgi?id=903411)
>
> Thank you,
> Timur
>
Cheers,
Timur
[-- Attachment #2: Type: text/html, Size: 3341 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] LVM thin pool discard_max_bytes reports 0
2014-08-07 5:03 ` Timur Alperovich
@ 2014-08-07 7:57 ` Zdenek Kabelac
0 siblings, 0 replies; 3+ messages in thread
From: Zdenek Kabelac @ 2014-08-07 7:57 UTC (permalink / raw)
To: LVM general discussion and development
Dne 7.8.2014 07:03, Timur Alperovich napsal(a):
> I have managed to answer my own questions.
>
> On Wed, Aug 6, 2014 at 8:48 PM, Timur Alperovich <timur@maginatics.com
> <mailto:timur@maginatics.com>> wrote:
>
> Hi there,
>
> I was trying to understand why fstrim would fail on an LVM thin
> provisioned volume and figured out that the discard_max_bytes is reported
> as 0 in /sys/block/dm-N/queue/discard_max_bytes (I checked the device that
> corresponded to the LVM pool that the volume is created within). The
> discard options are also disabled for the thin volume itself. I'm
> observing this issue on an Ubuntu 12.04 system, running kernel 3.8.0-32,
> and LVM2 2.02.98 backported to Ubuntu 12.04
> (https://launchpad.net/~timur-alperovich/+archive/ubuntu/ppa/+packages).
>
> I did a small experiment where I created another LVM pool within the same
> volume group and the discard value was set to 65536 for that device. I'm
> not sure if it matters, but the system is an running on ESXi 5.0 host.
> While I don't necessarily expect discard to propagate to the host, I was
> hoping to reclaim the block in the thin pool itself.
>
> Could anyone shed some light on why discard may be disabled on an LVM thin
> pool device? I tried looking for any bugs specific to TRIM or discard
> subsequent to 2.02.98, but could not find anything definitive.
>
>
> I noticed the following in the 2.02.98 changelog:
> "Reinstate correct default to ignore discards for thin metadata from old tools."
>
> and this looks like the associated commit:
> commit 109b3bb49b31d5fa7f6d0dd23345d703ab866ad6
> Author: Zdenek Kabelac <zkabelac@redhat.com <mailto:zkabelac@redhat.com>>
> Date: Tue Aug 21 15:51:54 2012 +0200
>
> thin: discard
> The commit changes the default discard value to "ignore" and this can be
> confirmed with lvs -o +discards
>
>
> Also, is there a way to enable discard without having to recreate the thin
> pool?
>
>
> Yes, it can be changed with lvchange --discards passdown (being mindful of
> https://bugzilla.redhat.com/show_bug.cgi?id=903411)
>
>
> Thank you,
> Timur
Be sure your kernel has this commit:
09869de57ed2728ae3c619803932a86cb0e2c4f8
Zdenek
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-07 7:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-07 3:48 [linux-lvm] LVM thin pool discard_max_bytes reports 0 Timur Alperovich
2014-08-07 5:03 ` Timur Alperovich
2014-08-07 7:57 ` Zdenek Kabelac
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).