Bug 814766
Summary: | Provide configurable discard options for thin volumes | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Alasdair Kergon <agk> |
Component: | lvm2 | Assignee: | Zdenek Kabelac <zkabelac> |
Status: | CLOSED ERRATA | QA Contact: | Cluster QE <mspqa-list> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.4 | CC: | agk, cmarthal, dwysocha, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, thornber, zkabelac |
Target Milestone: | rc | Keywords: | FutureFeature |
Target Release: | 6.4 | ||
Hardware: | Unspecified | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | lvm2-2.02.98-1.el6 | Doc Type: | Enhancement |
Doc Text: |
Thin pool support has been enhanced with configurable discards support. A user may select from 3 types of behavior.
"passdown" is default and allows to pass-through discards requests to the thin pool backing device.
"nopassdown" is processing discards only on thin pool level, they are not passed to the backed device.
"ignore" simply ignores any discard request.
No default behavior might be useful to fine-tune performance for some workloads.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2013-02-21 08:09:26 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Alasdair Kergon
2012-04-20 15:32:51 UTC
Scope: Initially the LVM support should map directly onto the kernel support. (Further extensions like checking sysfs in advance and dmeventd fstrim will be considered later on a different bugzilla.) Kernel options (on the pool target) are: ignore_discard: Disable discard support. no_discard_passdown: Don't pass discards down to the underlying data device, but just remove the mapping. LVM already has in lvm.conf devices { # Issue discards to a logical volumes's underlying physical volume(s) when # the logical volume is no longer using the physical volumes' space (e.g. # lvremove, lvreduce, etc). Discards inform the storage that a region is # no longer in use. Storage that supports discards advertise the protocol # specific way discards should be issued by the kernel (TRIM, UNMAP, or # WRITE SAME with UNMAP bit set). Not all storage will support or benefit # from discards but SSDs and thinly provisioned LUNs generally do. If set # to 1, discards will only be issued if both the storage and kernel provide # support. # 1 enables; 0 disables. issue_discards = 0 } 1. lvm.conf activation setting 2. VG metadata LV segment parameter 3. lvcreate/lvchange cmdline option - writes into the VG metadata Two separate parameters or combined? Defaults? Precedence? This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux. This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development. This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4. Support for discard is uptream: Initial patch for this support starts here: https://www.redhat.com/archives/lvm-devel/2012-July/msg00034.html Several more patches followed which reordered some enum values and fixed default behavior for thin target drivers with and without discard support. Supported command line options for this: lvcreate --discards {ignore|nopassdown|passdown} For pre-discard thins the default is 'ignore' For discard-enabled thins the default is 'passdown' lvchange --discards {ignore|nopassdown|passdown} Here is unit test for this feature: # Create named pool only lvcreate -l1 --discards ignore -T vg/pool check lv_field vg/pool discards "ignore" lvcreate -l1 --discards nopassdown -T vg/pool1 check lv_field vg/pool1 discards "nopassdown" lvcreate -l1 --discards passdown -T vg/pool2 check lv_field vg/pool2 discards "passdown" lvchange --discards nopassdown vg/pool2 # cannot convert active ignore -> passdown not lvchange --discards passdown vg/pool # cannot convert active nopassdown -> ignore not lvchange --discards ignore vg/pool1 # deactivate lvchange -an vg/pool vg/pool1 lvchange --discards passdown vg/pool check lv_field $vg/pool discards "passdown" lvchange --discards ignore vg/pool1 check lv_field vg/pool1 discards "ignore" The creation of thin pools and a thin LV with discards support was successful as far as lv_fields goes: (03:05:42) [root@r6-node01:~]$ lvs -o +discards LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Discards lv_root VolGroup -wi-ao--- 7.54g lv_swap VolGroup -wi-ao--- 1.97g pool vg twi-a-tz- 4.00m 0.00 ignore pool1 vg twi-a-tz- 4.00m 0.00 nopassdown pool2 vg twi-a-tz- 4.00m 0.00 passdown thinlv0 vg Vwi-a-tz- 12.00m pool 0.00 ignore thinlv1 vg Vwi-a-tz- 12.00m pool1 0.00 nopassdown thinlv2 vg Vwi-a-tz- 12.00m pool2 0.00 passdown Is it expected that an activation of thin pool LV which was changed from ignore -> passdown is not successful? (03:12:55) [root@r6-node01:~]$ lvcreate -l5 --discards ignore -T vg/pool Logical volume "pool" created (03:13:40) [root@r6-node01:~]$ lvs -o +discards LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Discards lv_root VolGroup -wi-ao--- 7.54g lv_swap VolGroup -wi-ao--- 1.97g pool vg twi-a-tz- 20.00m 0.00 ignore (03:13:50) [root@r6-node01:~]$ lvcreate -T -V10M --name=thinlv0 vg/pool Rounding up size to full physical extent 12.00 MiB Logical volume "thinlv0" created (03:14:06) [root@r6-node01:~]$ lvs -o +discards LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Discards lv_root VolGroup -wi-ao--- 7.54g lv_swap VolGroup -wi-ao--- 1.97g pool vg twi-a-tz- 20.00m 0.00 ignore thinlv0 vg Vwi-a-tz- 12.00m pool 0.00 ignore (03:14:09) [root@r6-node01:~]$ lvchange --discards passdown vg/pool Cannot change discards state for active logical volume "pool". (03:14:21) [root@r6-node01:~]$ lvchange -an vg/pool (03:14:31) [root@r6-node01:~]$ lvchange --discards passdown vg/pool Logical volume "pool" changed (03:14:40) [root@r6-node01:~]$ lvs -o +discards LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert Discards lv_root VolGroup -wi-ao--- 7.54g lv_swap VolGroup -wi-ao--- 1.97g pool vg twi---tz- 20.00m 0.00 passdown thinlv0 vg Vwi-a-tz- 12.00m pool 0.00 passdown (03:14:50) [root@r6-node01:~]$ lvchange -ay vg/pool device-mapper: reload ioctl on failed: Invalid argument (03:16:31) [root@r6-node01:~]$ dmsetup ls --tree VolGroup-lv_swap (253:1) └─ (252:2) VolGroup-lv_root (253:0) └─ (252:2) vg-thinlv0 (253:6) └─vg-pool-tpool (253:4) ├─vg-pool_tdata (253:3) │ └─ (8:1) └─vg-pool_tmeta (253:2) └─ (8:129) vgchange -an vg && vgchange -ay vg works without issues though: (03:16:36) [root@r6-node01:~]$ vgchange -an vg && vgchange -ay vg 0 logical volume(s) in volume group "vg" now active 2 logical volume(s) in volume group "vg" now active Nope - I'll check this I filed bug 903411 for the issue Nenad saw in comment #13. I can reproduce it as well with the new discard options test cases. All the discard create/change combinations pass, marking this verified (SanityOnly) as I don't think bug 903411 is enough to block this feature. 2.6.32-354.el6.x86_64 lvm2-2.02.98-9.el6 BUILT: Wed Jan 23 10:06:55 CST 2013 lvm2-libs-2.02.98-9.el6 BUILT: Wed Jan 23 10:06:55 CST 2013 lvm2-cluster-2.02.98-9.el6 BUILT: Wed Jan 23 10:06:55 CST 2013 udev-147-2.43.el6 BUILT: Thu Oct 11 05:59:38 CDT 2012 device-mapper-1.02.77-9.el6 BUILT: Wed Jan 23 10:06:55 CST 2013 device-mapper-libs-1.02.77-9.el6 BUILT: Wed Jan 23 10:06:55 CST 2013 device-mapper-event-1.02.77-9.el6 BUILT: Wed Jan 23 10:06:55 CST 2013 device-mapper-event-libs-1.02.77-9.el6 BUILT: Wed Jan 23 10:06:55 CST 2013 cmirror-2.02.98-9.el6 BUILT: Wed Jan 23 10:06:55 CST 2013 Creating [ignore] discards thinpool volume and converting it to [nopassdown] discards lvcreate --thinpool POOL --discards ignore -L 2G snapper_thinp lvcreate --virtualsize 500M --thinpool snapper_thinp/POOL -n origin lvcreate -s /dev/snapper_thinp/origin -n snap Deactivating LV before conversion lvchange --discards nopassdown snapper_thinp/POOL Removing [nopassdown] thinpool and corresponding thin virtual volume and thin snapshot Creating [ignore] discards thinpool volume and converting it to [passdown] discards lvcreate --thinpool POOL --discards ignore -L 2G snapper_thinp lvcreate --virtualsize 500M --thinpool snapper_thinp/POOL -n origin lvcreate -s /dev/snapper_thinp/origin -n snap Deactivating LV before conversion lvchange --discards passdown snapper_thinp/POOL Removing [passdown] thinpool and corresponding thin virtual volume and thin snapshot Creating [nopassdown] discards thinpool volume and converting it to [ignore] discards lvcreate --thinpool POOL --discards nopassdown -L 2G snapper_thinp lvcreate --virtualsize 500M --thinpool snapper_thinp/POOL -n origin lvcreate -s /dev/snapper_thinp/origin -n snap Deactivating LV before conversion lvchange --discards ignore snapper_thinp/POOL Removing [ignore] thinpool and corresponding thin virtual volume and thin snapshot Creating [nopassdown] discards thinpool volume and converting it to [passdown] discards lvcreate --thinpool POOL --discards nopassdown -L 2G snapper_thinp lvcreate --virtualsize 500M --thinpool snapper_thinp/POOL -n origin lvcreate -s /dev/snapper_thinp/origin -n snap lvchange --discards passdown snapper_thinp/POOL Removing [passdown] thinpool and corresponding thin virtual volume and thin snapshot Creating [passdown] discards thinpool volume and converting it to [ignore] discards lvcreate --thinpool POOL --discards passdown -L 2G snapper_thinp lvcreate --virtualsize 500M --thinpool snapper_thinp/POOL -n origin lvcreate -s /dev/snapper_thinp/origin -n snap Deactivating LV before conversion lvchange --discards ignore snapper_thinp/POOL Removing [ignore] thinpool and corresponding thin virtual volume and thin snapshot Creating [passdown] discards thinpool volume and converting it to [nopassdown] discards lvcreate --thinpool POOL --discards passdown -L 2G snapper_thinp lvcreate --virtualsize 500M --thinpool snapper_thinp/POOL -n origin lvcreate -s /dev/snapper_thinp/origin -n snap lvchange --discards nopassdown snapper_thinp/POOL Removing [nopassdown] thinpool and corresponding thin virtual volume and thin snapshot Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0501.html |