Bug 814824 - Support thin pools with non-power-of-2 block sizes between 64K and 1G, in 64K increments
Support thin pools with non-power-of-2 block sizes between 64K and 1G, in 64K...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
6.4
Unspecified Linux
medium Severity medium
: rc
: ---
Assigned To: Zdenek Kabelac
Cluster QE
: FutureFeature
Depends On: 814823
Blocks: 886216
  Show dependency treegraph
 
Reported: 2012-04-20 15:07 EDT by Alasdair Kergon
Modified: 2013-02-21 03:09 EST (History)
12 users (show)

See Also:
Fixed In Version: lvm2-2.02.98-5.el6
Doc Type: Enhancement
Doc Text:
Thin pool now also supports non power of 2 chunk sizes. So user now could select better values to fit i.e. striping. The limitation for chunk size is to be a multiply of 64KiB.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:09:37 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alasdair Kergon 2012-04-20 15:07:46 EDT
Make dm thin bug 814823 available through lvm2.
Comment 1 RHEL Product and Program Management 2012-07-10 02:07:30 EDT
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.
Comment 2 RHEL Product and Program Management 2012-07-10 19:57:32 EDT
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.
Comment 3 Corey Marthaler 2012-07-26 15:44:44 EDT
QE reviewed this BZ for QA_ACK but was unable to ack due to a lack of
requirements or description of how the new feature is supposed to work or be
tested.

Please see
https://wiki.test.redhat.com/ClusterStorage/WhyNoAck
Comment 4 Corey Marthaler 2012-08-09 13:53:50 EDT
QA planning phase ends Aug 10th (tomorrow), without more information this feature will likely be nacked by QA.

https://engineering.redhat.com/program/rhel/rhel-6-4-0/
Comment 5 Zdenek Kabelac 2012-08-10 15:28:02 EDT
This bugzilla should be tested by specifying --chunksize from range 64K  to 1G - which could be divided by 4K  (so   64K, 68K....)
Unlike currently where use could select  64K, 128K, 256K....

Advantage here should be, that if striped LV is used for thin pool the better matching chunksize could be use for non power of 2 stripe sizes.
Comment 6 Corey Marthaler 2012-08-13 12:47:00 EDT
Adding QA ack for 6.4. 

Devel will need to provide unit testing results however before this bug can be
ultimately verified by QA.
Comment 7 Zdenek Kabelac 2012-10-11 05:58:19 EDT
Upstream support with:

https://www.redhat.com/archives/lvm-devel/2012-October/msg00071.html


Example of usage:


lvcreate -T vg/thin -c 192 -L20M


Limitation:

User may use  chunk_size as multiple of 64KiB (the minimal chunk size)
While using non-power-of-2 chunk size  discards has to use 'ignore' mode
(lvcreate will issue a warning for such case and use this mode automatically)
Comment 9 Nenad Peric 2012-11-30 02:27:23 EST
Based on Comment #7 marking this as verified, tested only with 64k increments starting at 64k up until 1g. 

The command executed was properly warning about the change of mode in case of non-power-of-2 chunk sizes, as expected.

Tested with:

lvm2-2.02.98-3.el6
lvm2-cluster-2.02.98-3.el6
device-mapper-1.02.77-3.el6

kernel-2.6.32-343.el6
Comment 10 Mike Snitzer 2012-11-30 08:22:45 EST
(In reply to comment #7)
> Limitation:
> 
> User may use  chunk_size as multiple of 64KiB (the minimal chunk size)
> While using non-power-of-2 chunk size  discards has to use 'ignore' mode
> (lvcreate will issue a warning for such case and use this mode automatically)

This limitation doesn't exist in RHEL6.4 kernel (see rhel6.git commit 74e8b7d48b378 "dm-thin: support discard with non power of two blocksize")!

Kabi, I really think this needs to be resolved.
Comment 11 Zdenek Kabelac 2012-11-30 08:30:30 EST
It's already in upstream lvm git.
It should be part of next lvm RHEL6.4 build.

https://www.redhat.com/archives/lvm-devel/2012-November/msg00062.html
https://www.redhat.com/archives/lvm-devel/2012-November/msg00060.html
Comment 17 Corey Marthaler 2012-12-07 15:36:43 EST
I updated the subject, and will mark this verified based on those requirements (and not what's in comment #5).

2.6.32-343.el6.x86_64
lvm2-2.02.98-4.el6    BUILT: Wed Dec  5 08:35:04 CST 2012
lvm2-libs-2.02.98-4.el6    BUILT: Wed Dec  5 08:35:04 CST 2012
lvm2-cluster-2.02.98-4.el6    BUILT: Wed Dec  5 08:35:04 CST 2012
udev-147-2.43.el6    BUILT: Thu Oct 11 05:59:38 CDT 2012
device-mapper-1.02.77-4.el6    BUILT: Wed Dec  5 08:35:04 CST 2012
device-mapper-libs-1.02.77-4.el6    BUILT: Wed Dec  5 08:35:04 CST 2012
device-mapper-event-1.02.77-4.el6    BUILT: Wed Dec  5 08:35:04 CST 2012
device-mapper-event-libs-1.02.77-4.el6    BUILT: Wed Dec  5 08:35:04 CST 2012
cmirror-2.02.98-4.el6    BUILT: Wed Dec  5 08:35:04 CST 2012


SCENARIO - [valid_non_power_2_chunksizes]
Create pool volumes using possible (*non* power of 2) chunksizes from 68K to 1048572K

Creating [64] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_64 --chunksize 64 -L 2G snapper_thinp
Removing [64] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [128] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_128 --chunksize 128 -L 2G snapper_thinp
Removing [128] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [192] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_192 --chunksize 192 -L 2G snapper_thinp
  WARNING: Using discards ignore for chunk size non power of 2.
Removing [192] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [256] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_256 --chunksize 256 -L 2G snapper_thinp
Removing [256] chunksize thinpool and corresponding thin virtual volume and thin snapshot

[...]

Creating [712448] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_712448 --chunksize 712448 -L 2G snapper_thinp
  WARNING: Using discards ignore for chunk size non power of 2.
Removing [712448] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [712512] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_712512 --chunksize 712512 -L 2G snapper_thinp
  WARNING: Using discards ignore for chunk size non power of 2.
Removing [712512] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [712576] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_712576 --chunksize 712576 -L 2G snapper_thinp
  WARNING: Using discards ignore for chunk size non power of 2.
Removing [712576] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [712640] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_712640 --chunksize 712640 -L 2G snapper_thinp
  WARNING: Using discards ignore for chunk size non power of 2.
Removing [712640] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Deleting VG snapper_thinp
Deleting PVs /dev/etherd/e1.1p1 /dev/etherd/e1.1p2
Comment 18 Mike Snitzer 2012-12-07 15:53:48 EST
(In reply to comment #17)

> Creating [192] chunksize thinpool volume and corresponding thin virtual
> volume and thin snapshot
> lvcreate --thinpool POOL_192 --chunksize 192 -L 2G snapper_thinp
>   WARNING: Using discards ignore for chunk size non power of 2.
> Removing [192] chunksize thinpool and corresponding thin virtual volume and
> thin snapshot

This is the 2nd bug I've seen where lvm2 is emitting:
"WARNING: Using discards ignore for chunk size non power of 2."

As I said before that needs to be fixed for RHEL6.4 (there is no reason to disable discard with non-power of 2 chunksize).  Kabi, did that lvm2 fix get flagged for Peter to backport to RHEL6.4 lvm2?
Comment 19 Nenad Peric 2012-12-11 04:29:22 EST

Just a confirmation here.

I thought that the warning should have been fixed in the newest version of lvm, namely lvm2-2.02.98-4.el6, but I have it installed and the warnings are still there. Maybe a newer lvm version is needed?

When I run a few tests, I am still getting it, like Corey did:

Creating with 192 KB chunksize
  WARNING: Using discards ignore for chunk size non power of 2.
Chunk size reported:   192.00k
And removing...

Creating with 256 KB chunksize
Chunk size reported:   256.00k
And removing...

Creating with 320 KB chunksize
  WARNING: Using discards ignore for chunk size non power of 2.
Chunk size reported:   320.00k
And removing...
Comment 20 Zdenek Kabelac 2012-12-11 05:47:22 EST
While the original bug was fix, the new bug was introduced, which unfortunately masked itself with another bug thus technically the while the thin pool was set to 'ignore' discard, the live kernel target has been set in a way to passdown discards so it has passed some basic testing.

These 2 upstream patches should beat this issue:

https://www.redhat.com/archives/lvm-devel/2012-December/msg00019.html
https://www.redhat.com/archives/lvm-devel/2012-December/msg00020.html

So for the non-power-of-2 chunk sizes (i.e. -c 192k) passdown should be still supported with latest 6.4 kernel.
Comment 22 Corey Marthaler 2012-12-12 18:38:10 EST
No longer seeing "WARNING" messages when running this test case. That said, there are still messages to the console. Should those still exist?

[...]
device-mapper: thin: Data device (dm-3) discard unsupported: Disabling discard passdown.
device-mapper: thin: Data device (dm-3) discard unsupported: Disabling discard passdown.
device-mapper: thin: Data device (dm-3) discard unsupported: Disabling discard passdown.
device-mapper: thin: Data device (dm-3) discard unsupported: Disabling discard passdown.
device-mapper: thin: Data device (dm-3) discard unsupported: Disabling discard passdown.
[...]





============================================================
Iteration 2 of 2 started at Wed Dec 12 17:33:50 CST 2012
============================================================
SCENARIO - [valid_non_power_2_chunksizes]
Create pool volumes using possible (*non* power of 2) chunksizes from 68K to 1048572K

Creating [64] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_64 --chunksize 64 -L 2G snapper_thinp
Removing [64] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [128] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_128 --chunksize 128 -L 2G snapper_thinp
Removing [128] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [192] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_192 --chunksize 192 -L 2G snapper_thinp
Removing [192] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [256] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_256 --chunksize 256 -L 2G snapper_thinp
Removing [256] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [384] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_384 --chunksize 384 -L 2G snapper_thinp
Removing [384] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [448] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_448 --chunksize 448 -L 2G snapper_thinp
Removing [448] chunksize thinpool and corresponding thin virtual volume and thin snapshot

[...]

Creating [712448] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_712448 --chunksize 712448 -L 2G snapper_thinp
Removing [712448] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [712512] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_712512 --chunksize 712512 -L 2G snapper_thinp
Removing [712512] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [712576] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_712576 --chunksize 712576 -L 2G snapper_thinp
Removing [712576] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [712640] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_712640 --chunksize 712640 -L 2G snapper_thinp
Removing [712640] chunksize thinpool and corresponding thin virtual volume and thin snapshot

Creating [1048576] chunksize thinpool volume and corresponding thin virtual volume and thin snapshot
lvcreate --thinpool POOL_1048576 --chunksize 1048576 -L 2G snapper_thinp
Removing [1048576] chunksize thinpool and corresponding thin virtual volume and thin snapshot



Deleting VG snapper_thinp
Deleting PVs /dev/sdb1 /dev/sdd1
Comment 23 Zdenek Kabelac 2012-12-13 03:27:11 EST
(In reply to comment #22)
> No longer seeing "WARNING" messages when running this test case. That said,
> there are still messages to the console. Should those still exist?
> 
> [...]
> device-mapper: thin: Data device (dm-3) discard unsupported: Disabling
> discard passdown.
> device-mapper: thin: Data device (dm-3) discard unsupported: Disabling
> discard passdown.
> device-mapper: thin: Data device (dm-3) discard unsupported: Disabling
> discard passdown.
> device-mapper: thin: Data device (dm-3) discard unsupported: Disabling
> discard passdown.
> device-mapper: thin: Data device (dm-3) discard unsupported: Disabling
> discard passdown.
> [...]

These message states that your 'data' backend device does not support discard operation, thus  the pool will operate in  no_passdown mode.

The future version of lvm might try to detect stacked devices before finalizing table target line and switch to nopassdown with user-space warning.

For now it's just kernel information.

LVM2 metadata correctly keeps the information about discard passdown, and if the data device would be swapped with a discard-enabled device - it will properly use passdown mode. (Check with lvs -o+discards)

So to properly check there is right passdown mode - you could currently
look at 'dmsetup status' for thin pool device and try to use with i.e. SSD.

For 6.5 there will be improved lvs to display these all this info without dmsetup.

For 6.4 version it's expected behavior.
Comment 24 Zdenek Kabelac 2013-02-07 09:43:26 EST
Improvement of lvs is tracked in Bug 908792.
Comment 25 errata-xmlrpc 2013-02-21 03:09:37 EST
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

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