summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-10-29 11:58:06 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2015-10-29 12:14:20 +0100
commit99237f0908d87592815f4bdf3c239e8a108e835c (patch)
tree40110ce04e2360bad9ad8a24bce242fdc9c1feeb
parent099466939e4d6bdbe4b105f6b052dee6fc99b9d4 (diff)
downloadlvm2-99237f0908d87592815f4bdf3c239e8a108e835c.tar.gz
thin: enable usage of kernel low_water_mark
Now with correctly functioning dmeventd enable usage of low_water_mark for faster reaction on pool's threshold. When user select e.g. 80% as a threshold value, dmeventd doesn't need to wait 10 seconds till monitoring timer expires, but nearly instantly resizes thin-pool to fit bellow threshold.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/thin/thin.c14
2 files changed, 14 insertions, 1 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 869e506c7..f453604c7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Thin pool targets uses low_water_mark from profile.
Dropping 'yet' from error of unsupported thick snapshot of snapshots.
Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
For thins use flush for suspend only when volume size is reduced.
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index 7bf7f4e69..d0424736c 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -266,6 +266,8 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
struct lvinfo info;
uint64_t transaction_id = 0;
unsigned attr;
+ uint64_t low_water_mark;
+ int threshold;
if (!_thin_target_present(cmd, NULL, &attr))
return_0;
@@ -294,10 +296,20 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
return 0;
}
+ threshold = find_config_tree_int(seg->lv->vg->cmd,
+ activation_thin_pool_autoextend_threshold_CFG,
+ lv_config_profile(seg->lv));
+ if (threshold < 50)
+ threshold = 50;
+ if (threshold < 100)
+ low_water_mark = (len * threshold + 99) / 100;
+ else
+ low_water_mark = len;
+
if (!dm_tree_node_add_thin_pool_target(node, len,
seg->transaction_id,
metadata_dlid, pool_dlid,
- seg->chunk_size, seg->low_water_mark,
+ seg->chunk_size, low_water_mark,
seg->zero_new_blocks ? 0 : 1))
return_0;