Skip to contentSkip to conversation

Running thin_trim before activating a thin pool

linux-lvm Demi Marie Obenour 3 participants 7 messages Jan 31, 2022

lore
Share & tools
lore
#0 lore raw

Is it possible to configure LVM2 so that it runs thin_trim before it activates a thin pool? Qubes OS currently runs blkdiscard on every thin volume before deleting it, which is slow and unreliable. Would running thin_trim during system startup provide a better alternative?

Signature · 3 lines
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab

_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#1 lore raw

Il 2022-01-29 18:45 Demi Marie Obenour ha scritto:

Quoted 4 lines

Is it possible to configure LVM2 so that it runs thin_trim before it activates a thin pool? Qubes OS currently runs blkdiscard on every thin volume before deleting it, which is slow and unreliable. Would running thin_trim during system startup provide a better alternative?

I think that, if anything, it would be worse: a long discard during boot can be problematic, even leading to timeout on starting other services. After all, blkdiscard should be faster then something done at higher level.

That said, I seem to remember that deleting a fat volume should automatically trim/discard it if issue_discard=1. Is this not true for thin volumes? Regards.

Signature · 11 lines
Danti Gionatan
Supporto Tecnico
Assyoma S.r.l. - www.assyoma.it
email: [email protected] - [email protected]
GPG public key ID: FF5F32A8

_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
#2 lore raw

Dne 31. 01. 22 v 12:02 Gionatan Danti napsal(a):

Quoted 10 lines

Il 2022-01-29 18:45 Demi Marie Obenour ha scritto:

Quoted 4 lines

Is it possible to configure LVM2 so that it runs thin_trim before it activates a thin pool?  Qubes OS currently runs blkdiscard on every thin volume before deleting it, which is slow and unreliable.  Would running thin_trim during system startup provide a better alternative?

I think that, if anything, it would be worse: a long discard during boot can be problematic, even leading to timeout on starting other services. After all, blkdiscard should be faster then something done at higher level.

That said, I seem to remember that deleting a fat volume should automatically trim/discard it if issue_discard=1. Is this not true for thin volumes?

'issue_discard' relates only to the internal lvm2 logic when some extents become free for reuse (so i.e. after 'lvremove/lvreduce/vgremove...'.

However since with thin volumes no physical extents of VG are released (as the thin volume is releasing chunks from the thin-pool) - there is no discard issued by lvm.

Regards

Zdenek

_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#3 lore raw

Il 2022-01-31 14:41 Zdenek Kabelac ha scritto:

Quoted 7 lines

'issue_discard' relates only to the internal lvm2 logic when some extents become free for reuse (so i.e. after 'lvremove/lvreduce/vgremove...'.

However since with thin volumes no physical extents of VG are released (as the thin volume is releasing chunks from the thin-pool) - there is no discard issued by lvm.

Ah, I missed that.
Thank you Zdenek.

Signature · 11 lines
Danti Gionatan
Supporto Tecnico
Assyoma S.r.l. - www.assyoma.it
email: [email protected] - [email protected]
GPG public key ID: FF5F32A8

_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
#4 lore raw
In reply to Gionatan Danti
Quoted 9 lines · Gionatan Danti

Il 2022-01-29 18:45 Demi Marie Obenour ha scritto:

Quoted 4 lines

Is it possible to configure LVM2 so that it runs thin_trim before it activates a thin pool? Qubes OS currently runs blkdiscard on every thin volume before deleting it, which is slow and unreliable. Would running thin_trim during system startup provide a better alternative?

I think that, if anything, it would be worse: a long discard during boot can be problematic, even leading to timeout on starting other services. After all, blkdiscard should be faster then something done at higher level.

thin_trim is a userspace tool that works on an entire thin pool, and I suspect it may be significantly faster than blkdiscard of an individual thin volume. That said, what I would *really* like is something equivalent to fstrim for thin volumes: a tool that works asynchronously, in the background, without disrupting concurrent I/O.

Quoted 6 lines
Signature · 5 lines
Danti Gionatan
Supporto Tecnico
Assyoma S.r.l. - www.assyoma.it
email: [email protected] - [email protected]
GPG public key ID: FF5F32A8

FYI, you might want to specify a full fingerprint here; short key IDs are highly vulnerable to collision and preimage attacks.

Signature · 3 lines
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab

_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#5 lore raw

Il 2022-01-31 16:28 Demi Marie Obenour ha scritto:

Quoted 5 lines

thin_trim is a userspace tool that works on an entire thin pool, and I suspect it may be significantly faster than blkdiscard of an individual thin volume. That said, what I would *really* like is something equivalent to fstrim for thin volumes: a tool that works asynchronously, in the background, without disrupting concurrent I/O.

Are you sure that fstrim works asynchronously?
I remember "fstrim -v /mybigdevice" tacking some time (~30s).

Quoted 2 lines

FYI, you might want to specify a full fingerprint here; short key IDs are highly vulnerable to collision and preimage attacks.

Yeah, it is a 15 years old signature I must decide to update ;) Thanks.

Signature · 11 lines
Danti Gionatan
Supporto Tecnico
Assyoma S.r.l. - www.assyoma.it
email: [email protected] - [email protected]
GPG public key ID: FF5F32A8

_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
#6 lore raw
Quoted 9 lines · Gionatan Danti

Il 2022-01-31 16:28 Demi Marie Obenour ha scritto:

Quoted 5 lines

thin_trim is a userspace tool that works on an entire thin pool, and I suspect it may be significantly faster than blkdiscard of an individual thin volume. That said, what I would *really* like is something equivalent to fstrim for thin volumes: a tool that works asynchronously, in the background, without disrupting concurrent I/O.

Are you sure that fstrim works asynchronously?
I remember "fstrim -v /mybigdevice" tacking some time (~30s).

It’s happens online and without preventing other I/O from happening, whereas thin_trim can only be run offline.

Quoted 5 lines
Quoted 2 lines

FYI, you might want to specify a full fingerprint here; short key IDs are highly vulnerable to collision and preimage attacks.

Yeah, it is a 15 years old signature I must decide to update ;) Thanks.

Might want to generate a new key while you are at it :) (especially if the old one is weak)

Signature · 3 lines
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab

_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/