Bug 1000597

Summary: introduce thin provisioning profiles for "performance" and "many snapshots"
Product: Red Hat Enterprise Linux 7 Reporter: Mike Snitzer <msnitzer>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
lvm2 sub component: Default / Unclassified QA Contact: cluster-qe <cluster-qe>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, thornber, zkabelac
Version: 7.0   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.103-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:59:10 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:

Description Mike Snitzer 2013-08-23 19:32:55 UTC
Description of problem:
We need 2 profiles that provide a heuristic for establishing a reaosnable default for the targeted usecase:
1) performance
2) many snapshots

These profiles will be exposed to users when configuring thinp at install time via anaconda selection.  If on the commandline the user can use: lvcreate --profile ...

Additional info:
The specifics of what the corresponding heuristics should be are TBD.

BUT, initial thoughts are:
1) performance - if pool's data device's 'optimal_io_size' is >= 512K use it.
Otherwise, use some default like 512K.
2) many snapshots - if pool's data device's 'minimun_io_size' is >= 64K use it.
Otherwise, use some default like 64K.

SO this speaks to the need to factor out and/or expose lvm2's code that looks up a device's IO hints (minimum_io_size and optimal_io_size).

Comment 2 Peter Rajnoha 2013-09-18 15:07:22 UTC
(In reply to Mike Snitzer from comment #0)
> BUT, initial thoughts are:
> 1) performance - if pool's data device's 'optimal_io_size' is >= 512K use it.

Mike, what if there are more devices with different IO hints that make the pool's data device? I guess the least common multiple of those values should be used then, right?

Comment 3 Peter Rajnoha 2013-09-25 14:15:23 UTC
Initial patchset in upstream now:

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=8bf425005c8a25e9b99a617a6cf7d9d826ad5f6a

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=cc9e65c391f9070c4b06a94a0ffdb9c61cf89c13

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=78cba8eb3fa262c2c4e1a5c5a3db3e4e0d7e6900

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=78cba8eb3fa262c2c4e1a5c5a3db3e4e0d7e6900

There's a new lvm.conf option "thin_pool_chunk_size_calculation":

+ # Specify chunk size calculation method for thin pool volumes.
+ # Possible options are:
+ # "default" - if thin_pool_chunk_size is defined, use it.
+ # Otherwise, calcucate the chunk size based on
+ # estimation and device hints exposed in sysfs:
+ # the minimum_io_size. The chunk size is always
+ # at least 64KiB.
+ #
+ # "performance" - if thin_pool_chunk_size is defined, use it.
+ # Otherwise, calculate the chunk size for
+ # performance based on device hints exposed in
+ # sysfs: the optimal_io_size. The chunk size is
+ # always at least 512KiB.
+ # thin_pool_chunk_size_calculation = "default"

This is then used in "thin-performance.profile" (together with allocation/thin_pool_zero=0). More tunables that will be set in this profile may follow...

To use the profile, just use "--profile thin-performance" with vgcreate/lvcreate command.

Comment 4 Peter Rajnoha 2013-09-25 14:18:42 UTC
(In reply to Peter Rajnoha from comment #3)
> Initial patchset in upstream now:
> 
> https://git.fedorahosted.org/cgit/lvm2.git/commit/
> ?id=8bf425005c8a25e9b99a617a6cf7d9d826ad5f6a
> 
> https://git.fedorahosted.org/cgit/lvm2.git/commit/
> ?id=cc9e65c391f9070c4b06a94a0ffdb9c61cf89c13
> 
> https://git.fedorahosted.org/cgit/lvm2.git/commit/
> ?id=78cba8eb3fa262c2c4e1a5c5a3db3e4e0d7e6900

+

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=dd796d6a9485287973e61c427ee45694965203a0

Comment 6 Peter Rajnoha 2014-04-01 13:54:20 UTC
Upstream test script - similar/same logic can be used to test this BZ:

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=504c328e3d2c0a8b6b946fe7d323e1f28887e285

Comment 7 Peter Rajnoha 2014-04-01 14:00:32 UTC
The "many-snapshots" profile in the summary is the default behaviour without any profile defined, which is this configuration exactly at the moment:
  allocation/chunk_size_calculation_policy="generic"
  allocation/thin_pool_zero="1"

The "performance" profile is the "thin-performance.profile" found in /etc/lvm/profile dir and it's this configuration:
  allocation/chunk_size_calculation_policy="performance"
  allocation/thin_pool_zero="0"

Comment 9 Corey Marthaler 2014-04-15 15:39:58 UTC
Marking verified in the latest rpms.

3.10.0-116.el7.x86_64
lvm2-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-libs-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-cluster-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-persistent-data-0.3.0-1.el7    BUILT: Fri Mar 28 07:42:24 CDT 2014
cmirror-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014

Comment 10 Ludek Smid 2014-06-13 10:59:10 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.