thinp-test-suite: support for non power of 2 pool blocksize
On Sat, Apr 28 2012 at 12:44am -0400,
Mike Snitzer <email@example.com> wrote:
> Non power of 2 blocksize support is needed to properly align thinp IO
> on storage that has non power of 2 optimal IO sizes (e.g. RAID6 10+2).
> Use do_div wrappers to support non power of 2 blocksize for the pool's
> data device. do_div provides comparable performance to the power of 2
> math that was performed until now (as tested on modern x86_64 hardware).
> Verify that the pool's blocksize is a multiple of 64K and that the
> pool's data device is a multiple of blocksize.
The non power of 2 support patch required quite a few thinp-test-suite
fixes; this works for me but there may be more clever/clean ways to
address rounding down the pool size to a multiple of blocksize...
diff --git a/pool_resize_tests.rb b/pool_resize_tests.rb
index 3b17b44..6c8eadf 100644
@@ -17,6 +17,8 @@ class PoolResizeTests < ThinpTestCase
@low_water_mark = 0
@data_block_size = 128
+ @size /= @data_block_size
+ @size *= @data_block_size
@@ -143,7 +145,7 @@ class PoolResizeTests < ThinpTestCase
# we create a pool with a really tiny data volume that wont be
# able to complete a mkfs.
- with_standard_pool(16) do |pool|
+ with_standard_pool(128) do |pool|
with_new_thin(pool, @volume_size, 0) do |thin|
event_tracker = pool.event_tracker;
dm-devel mailing list