RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1849009 - LVMVDO manpage is missing information about users responsibility for discarding unused fs blocks
Summary: LVMVDO manpage is missing information about users responsibility for discardi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: 8.0
Assignee: Zdenek Kabelac
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-19 13:15 UTC by Petr Beranek
Modified: 2021-09-07 11:51 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-17 13:45:55 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)

Description Petr Beranek 2020-06-19 13:15:50 UTC
Description of problem:
lvmvdo(7) does not contain explicit information that users are responsible for
discarding of unused file system blocks and it does not seem obvious from
the LVMVDO product itself. Lack of this knowlege may lead to wrong expectations
about LVMVDO volume behaviour and to
bug https://bugzilla.redhat.com/show_bug.cgi?id=1846036.

We should also provide recommendations or best practices (e.g. as a section of lvmvdo(7)) how to deal with it.


Version-Release number of selected component (if applicable):
lvm2-2.03.09-2.el8.x86_64 (RHEL8.3)

Comment 1 Zdenek Kabelac 2020-06-19 13:41:21 UTC
At this moment I'd probably not recommend to use  'fstrim' on regular basis on VDO volume - as it simply (IMHO) to CPU invasive and slow operation with VDO volumes (unlike with thin volumes) - and it really depends on a use-case.

In the case that such 'freed space' is later reused again by the filesystem - the discarding operation would dramatically 'slow down' user experience.
(and currently we support only a single VDO volume per VDO pool - so such 'free space' can't be used for other VDO volumes)

So 'fstrim' with VDO should really be used only in case where the user is running out of VDO device space and he expects some 'major' freeing of the space in filesystem - which is kind of not completely obvious to guess from a used filesystem  - as from 'df' need to be derived, how the used filesystem space is matching used space in VDO volume.

But surely we can provide some VDO man page chapter giving some useful math hints about this. But it's really an 'expert user' topic.

Also such 'VDO' user experience is not actually 'VDO only' related - it's more a 'common know-how' with usage of any provisioned volumes with common linux filesystems (XFS, extX,...) - so it might forth a separate man7 page -  as we sometimes see even bad combination of using ZFS, Btrfs on top of such devices which is causing performance degradations for users.

Comment 2 Roman Bednář 2020-06-29 08:33:47 UTC
So if 'fstrim' is not recommended what are the other correct ways to free up the vdo pool? 

I tested 'discard' mount option and that one does not work at all (still considering just a simple 'rm' operation), so I'm curious how this should be set up properly then.

Comment 3 Roman Bednář 2020-06-29 08:53:30 UTC
Sorry about the previous comment about 'discard' mount. Must have done something wrong last time because it seems to work just fine when I tried it today:


# lvs -o lv_name,data_percent vg
  LV        Data%
  vdovolume 28.53
  vpool0    50.06

# df -h /mnt/test
Filesystem                Size  Used Avail Use% Mounted on
/dev/mapper/vg-vdovolume  6.9G  2.0G  4.5G  31% /mnt/test

# mount | grep /mnt/test
/dev/mapper/vg-vdovolume on /mnt/test type ext4 (rw,relatime,seclabel,discard)

# rm -rf /mnt/test/file

# lvs -o lv_name,data_percent vg
  LV        Data%
  vdovolume 0.52
  vpool0    30.53


Anyway, if this is the recommended way of using lvm vdo (with continuous discard) it would be certainly nice to have this highlighted somewhere. Hard to say how well known this is but few lines about this in manpage sounds reasonable. Or how about a hint message when creating the vdo volume?

Comment 4 Zdenek Kabelac 2020-06-29 10:57:59 UTC
Nope - in fact, personally I'd never recommend to mount fs with 'discard' option enabled.
This is simply slow and inefficient.

In general users should NOT need to use discard with VDO volume - when they are overwriting SAME data space - i.e.
user writes file & removes file & writes file again - there is no need to discard in between - it will kill performance.

User MAY need to use discard if he are basically wants to really free some space in the VDO pool.

Then you SHOULD use  fstrim  -  there is just big warning - IT WILL BE SLOW! - so it will takes it's time.
There is nothing better ATM you can do.

So comment 2 is not correct -  usage of trimming on VDO device should be  much more limited compared  to
other device types - but user of course can use it, he just needs to be aware it is very CPU&disk intesive operation,
that can heavily impact performance of the system while  TRIM operation is running.

Comment 5 Roman Bednář 2020-06-29 13:55:30 UTC
Alright, that sounds like users need to be pretty sure about the data duplicity up front. Because with each write of data that can *not* be deduplicated the pool % will just keep going up. So if the prediction is wrong and such data keep going in and out the device it could fill up the pool pretty quick. Seems a bit odd but if that's the use case...

Having that in mind it seems quite crucial to keep track of vdo pool efficiency. Is this the recommended/only way of checking it now?

# lvs -o lv_name,vdo_saving_percent vg
  LV        VDOSaving%
  vdovolume       0.12
  vpool0          0.12

# cp /mnt/test/file /mnt/test/file2

# lvs -o lv_name,vdo_saving_percent vg
  LV        VDOSaving%
  vdovolume      47.03
  vpool0         47.03

Comment 6 Zdenek Kabelac 2020-06-29 21:52:31 UTC
Yeah - running 'fstrim' without 'a good reason' for it - isn't very practical with VDO volume - price is relatively high.

NoteI: using overprovisioning with small VDO pool and large VDO volume and storing there content of '/dev/urandom' isn't the case  VDO is targeting to solve.  Clearly VDO is serving to user having large data duplicity - otherwise again - user is paying large amount of CPU cycle & disk bandwith to store something which can be way more efficiently stored on a linear device.

So while the starting example of this BZ is nice way to 'hit corner' cases of overfilling VDO pools quickly, the overall usage of TRIM is not needed that much (just like with modern SSD) - there is 'some help' if you use it -but it should also work without it.

NoteII: once lvm2 will deploy multiple VDO LVs per single VDO pool - usage of TRIM may relax/free space in VDO pool for 'other VDO LVs' in the same pool - but that's currently not supported.

Monitoring of VDO pools should be used as a way how to extend VDO pool 'just-in-time' where the free space is get low.

Overprovisioning is not meant to be used like an 'overfilled filesystem' - it's incomparable.  It's more about postponing adding necessary space when it's needed (i.e. adding new disk into VG). Reaching device out-of-space condition is not going to be 'user pleasant' experience, where user can easily continue to use such device - unless whole device stack together would filesystem would be heavily cooperative.

Saying this means - a user who whish to operate his dm VDO (or dm thin-pool) with nearly 'full pool' - needs to pick different technology.

Comment 7 Jonathan Earl Brassow 2020-07-15 04:43:17 UTC
FWIW, the VDO team is working on improving discard performance.  Perhaps we can update the man page when that is ready.  (Rather than recommend something that will be noticeably slow.)  OTOH, it might be useful at the moment to mention discards /and/ mention that it is currently slow.

Comment 10 Petr Beranek 2020-12-17 13:45:55 UTC
Resolved by fix for https://bugzilla.redhat.com/show_bug.cgi?id=1855804.

Manpage now warns user about limitations when using discard operation.


Note You need to log in before you can comment on or make changes to this bug.