mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 3 years ago
Clone

Blame SOURCES/lvm2-2_03_03-lib-move-towards-v2-version-of-VDO-format.patch

146ac4
 WHATS_NEW                      |  4 ++++
146ac4
 WHATS_NEW_DM                   |  4 ++++
146ac4
 device_mapper/all.h            |  1 +
146ac4
 device_mapper/libdm-deptree.c  | 16 ++++++++-----
146ac4
 device_mapper/vdo/target.h     | 15 ++++++------
146ac4
 device_mapper/vdo/vdo_limits.h |  7 ++++--
146ac4
 device_mapper/vdo/vdo_target.c | 20 +++++++++++-----
146ac4
 lib/config/config_settings.h   | 54 ++++++++++++++++++++++++------------------
146ac4
 lib/config/defaults.h          |  8 +++----
146ac4
 lib/metadata/vdo_manip.c       | 16 ++++++-------
146ac4
 lib/vdo/vdo.c                  | 44 +++++++++++++++++-----------------
146ac4
 11 files changed, 110 insertions(+), 79 deletions(-)
146ac4
146ac4
diff --git a/WHATS_NEW b/WHATS_NEW
146ac4
index 9cdc70e..4f752fa 100644
146ac4
--- a/WHATS_NEW
146ac4
+++ b/WHATS_NEW
146ac4
@@ -1,3 +1,7 @@
146ac4
+Version 2.03.03 - 
146ac4
+====================================
146ac4
+  Move VDO support towards V2 target (6.2) support.
146ac4
+
146ac4
 Version 2.03.02 - 18th December 2018
146ac4
 ====================================
146ac4
   Fix missing proper initialization of pv_list struct when adding pv.
146ac4
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
146ac4
index 8fe5010..24148d8 100644
146ac4
--- a/WHATS_NEW_DM
146ac4
+++ b/WHATS_NEW_DM
146ac4
@@ -1,3 +1,7 @@
146ac4
+Version 1.02.157 - 
146ac4
+=====================================
146ac4
+  Fix compilation of vdo status parsing in dmeventd.
146ac4
+
146ac4
 Version 1.02.155 - 18th December 2018
146ac4
 =====================================
146ac4
   Include correct internal header inside libdm list.c.
146ac4
diff --git a/device_mapper/all.h b/device_mapper/all.h
146ac4
index 2c452ab..b9a7a90 100644
146ac4
--- a/device_mapper/all.h
146ac4
+++ b/device_mapper/all.h
146ac4
@@ -924,6 +924,7 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node,
146ac4
 int dm_tree_node_add_vdo_target(struct dm_tree_node *node,
146ac4
 				uint64_t size,
146ac4
 				const char *data_uuid,
146ac4
+				uint64_t data_size,
146ac4
 				const struct dm_vdo_target_params *param);
146ac4
 
146ac4
 /*
146ac4
diff --git a/device_mapper/libdm-deptree.c b/device_mapper/libdm-deptree.c
146ac4
index d3a5c27..ed96378 100644
146ac4
--- a/device_mapper/libdm-deptree.c
146ac4
+++ b/device_mapper/libdm-deptree.c
146ac4
@@ -207,6 +207,7 @@ struct load_segment {
146ac4
 	struct dm_tree_node *vdo_data;  /* VDO */
146ac4
 	struct dm_vdo_target_params vdo_params; /* VDO */
146ac4
 	const char *vdo_name;           /* VDO - device name is ALSO passed as table arg */
146ac4
+	uint64_t vdo_data_size;		/* VDO - size of data storage device */
146ac4
 };
146ac4
 
146ac4
 /* Per-device properties */
146ac4
@@ -2647,17 +2648,18 @@ static int _vdo_emit_segment_line(struct dm_task *dmt,
146ac4
 		return 0;
146ac4
 	}
146ac4
 
146ac4
-	EMIT_PARAMS(pos, "%s %u %s " FMTu64 " " FMTu64 " %u on %s %s "
146ac4
-		    "ack=%u,bio=%u,bioRotationInterval=%u,cpu=%u,hash=%u,logical=%u,physical=%u",
146ac4
+	EMIT_PARAMS(pos, "V2 %s " FMTu64 " %u " FMTu64 " %u %s %s %s "
146ac4
+		    "maxDiscard %u ack %u bio %u bioRotationInterval %u cpu %u hash %u logical %u physical %u",
146ac4
 		    data_dev,
146ac4
-		    (seg->vdo_params.emulate_512_sectors == 0) ? 4096 : 512,
146ac4
-		    seg->vdo_params.use_read_cache ? "enabled" : "disabled",
146ac4
-		    seg->vdo_params.read_cache_size_mb * UINT64_C(256),		// 1MiB -> 4KiB units
146ac4
+		    seg->vdo_data_size / 8, // this parameter is in 4K units
146ac4
+		    seg->vdo_params.minimum_io_size,
146ac4
 		    seg->vdo_params.block_map_cache_size_mb * UINT64_C(256),	// 1MiB -> 4KiB units
146ac4
-		    seg->vdo_params.block_map_period,
146ac4
+		    seg->vdo_params.block_map_era_length,
146ac4
+		    seg->vdo_params.use_metadata_hints ? "on" : "off" ,
146ac4
 		    (seg->vdo_params.write_policy == DM_VDO_WRITE_POLICY_SYNC) ? "sync" :
146ac4
 			(seg->vdo_params.write_policy == DM_VDO_WRITE_POLICY_ASYNC) ? "async" : "auto", // policy
146ac4
 		    seg->vdo_name,
146ac4
+		    seg->vdo_params.max_discard,
146ac4
 		    seg->vdo_params.ack_threads,
146ac4
 		    seg->vdo_params.bio_threads,
146ac4
 		    seg->vdo_params.bio_rotation,
146ac4
@@ -4034,6 +4036,7 @@ int dm_tree_node_add_cache_target_base(struct dm_tree_node *node,
146ac4
 int dm_tree_node_add_vdo_target(struct dm_tree_node *node,
146ac4
 				uint64_t size,
146ac4
 				const char *data_uuid,
146ac4
+				uint64_t data_size,
146ac4
 				const struct dm_vdo_target_params *vtp)
146ac4
 {
146ac4
 	struct load_segment *seg;
146ac4
@@ -4054,6 +4057,7 @@ int dm_tree_node_add_vdo_target(struct dm_tree_node *node,
146ac4
 
146ac4
 	seg->vdo_params = *vtp;
146ac4
 	seg->vdo_name = node->name;
146ac4
+	seg->vdo_data_size = data_size;
146ac4
 
146ac4
 	node->props.send_messages = 2;
146ac4
 
146ac4
diff --git a/device_mapper/vdo/target.h b/device_mapper/vdo/target.h
146ac4
index c597491..f83cffd 100644
146ac4
--- a/device_mapper/vdo/target.h
146ac4
+++ b/device_mapper/vdo/target.h
146ac4
@@ -74,16 +74,16 @@ enum dm_vdo_write_policy {
146ac4
 
146ac4
 // FIXME: review whether we should use the createParams from the userlib
146ac4
 struct dm_vdo_target_params {
146ac4
+	uint32_t minimum_io_size;
146ac4
 	uint32_t block_map_cache_size_mb;
146ac4
-	uint32_t block_map_period;
146ac4
+	uint32_t block_map_era_length;	// format period
146ac4
 
146ac4
 	uint32_t check_point_frequency;
146ac4
-	uint32_t index_memory_size_mb;
146ac4
+	uint32_t index_memory_size_mb;  // format
146ac4
 
146ac4
-	uint32_t read_cache_size_mb;
146ac4
-
146ac4
-	uint32_t slab_size_mb;
146ac4
+	uint32_t slab_size_mb;          // format
146ac4
 
146ac4
+	uint32_t max_discard;
146ac4
 	// threads
146ac4
 	uint32_t ack_threads;
146ac4
 	uint32_t bio_threads;
146ac4
@@ -95,9 +95,8 @@ struct dm_vdo_target_params {
146ac4
 
146ac4
 	bool use_compression;
146ac4
 	bool use_deduplication;
146ac4
-	bool emulate_512_sectors;
146ac4
-	bool use_sparse_index;
146ac4
-	bool use_read_cache;
146ac4
+	bool use_metadata_hints;
146ac4
+	bool use_sparse_index;          // format
146ac4
 
146ac4
 	// write policy
146ac4
 	enum dm_vdo_write_policy write_policy;
146ac4
diff --git a/device_mapper/vdo/vdo_limits.h b/device_mapper/vdo/vdo_limits.h
146ac4
index 40cf204..e145100 100644
146ac4
--- a/device_mapper/vdo/vdo_limits.h
146ac4
+++ b/device_mapper/vdo/vdo_limits.h
146ac4
@@ -21,8 +21,8 @@
146ac4
 #define DM_VDO_BLOCK_MAP_CACHE_SIZE_MAXIMUM_MB	(16 * 1024 * 1024 - 1)	// 16TiB - 1
146ac4
 #define DM_VDO_BLOCK_MAP_CACHE_SIZE_MINIMUM_PER_LOGICAL_THREAD  (4096 * DM_VDO_BLOCK_SIZE_KB)
146ac4
 
146ac4
-#define DM_VDO_BLOCK_MAP_PERIOD_MINIMUM		1
146ac4
-#define DM_VDO_BLOCK_MAP_PERIOD_MAXIMUM		(16380)
146ac4
+#define DM_VDO_BLOCK_MAP_ERA_LENGTH_MINIMUM	(1)
146ac4
+#define DM_VDO_BLOCK_MAP_ERA_LENGTH_MAXIMUM	(16380)
146ac4
 
146ac4
 #define DM_VDO_INDEX_MEMORY_SIZE_MINIMUM_MB	(256)			// 0.25 GiB
146ac4
 #define DM_VDO_INDEX_MEMORY_SIZE_MAXIMUM_MB	(1024 * 1024 * 1024)	// 1TiB
146ac4
@@ -57,4 +57,7 @@
146ac4
 //#define DM_VDO_PHYSICAL_THREADS_MINIMUM	(0)
146ac4
 #define DM_VDO_PHYSICAL_THREADS_MAXIMUM		(16)
146ac4
 
146ac4
+#define DM_VDO_MAX_DISCARD_MINIMUM		(1)
146ac4
+#define DM_VDO_MAX_DISCARD_MAXIMUM		(UINT32_MAX / 4096)
146ac4
+
146ac4
 #endif // DEVICE_MAPPER_VDO_LIMITS_H
146ac4
diff --git a/device_mapper/vdo/vdo_target.c b/device_mapper/vdo/vdo_target.c
146ac4
index c488023..976d71a 100644
146ac4
--- a/device_mapper/vdo/vdo_target.c
146ac4
+++ b/device_mapper/vdo/vdo_target.c
146ac4
@@ -23,6 +23,13 @@ bool dm_vdo_validate_target_params(const struct dm_vdo_target_params *vtp,
146ac4
 {
146ac4
 	bool valid = true;
146ac4
 
146ac4
+	if ((vtp->minimum_io_size != 512) &&
146ac4
+	    (vtp->minimum_io_size != 4096)) {
146ac4
+		log_error("VDO minimum io size %u is unsupported.",
146ac4
+			  vtp->minimum_io_size);
146ac4
+		valid = false;
146ac4
+	}
146ac4
+
146ac4
 	if ((vtp->block_map_cache_size_mb < DM_VDO_BLOCK_MAP_CACHE_SIZE_MINIMUM_MB) ||
146ac4
 	    (vtp->block_map_cache_size_mb > DM_VDO_BLOCK_MAP_CACHE_SIZE_MAXIMUM_MB)) {
146ac4
 		log_error("VDO block map cache size %u out of range.",
146ac4
@@ -37,12 +44,6 @@ bool dm_vdo_validate_target_params(const struct dm_vdo_target_params *vtp,
146ac4
 		valid = false;
146ac4
 	}
146ac4
 
146ac4
-	if (vtp->read_cache_size_mb > DM_VDO_READ_CACHE_SIZE_MAXIMUM_MB) {
146ac4
-		log_error("VDO read cache size %u out of range.",
146ac4
-			  vtp->read_cache_size_mb);
146ac4
-		valid = false;
146ac4
-	}
146ac4
-
146ac4
 	if ((vtp->slab_size_mb < DM_VDO_SLAB_SIZE_MINIMUM_MB) ||
146ac4
 	    (vtp->slab_size_mb > DM_VDO_SLAB_SIZE_MAXIMUM_MB)) {
146ac4
 		log_error("VDO slab size %u out of range.",
146ac4
@@ -50,6 +51,13 @@ bool dm_vdo_validate_target_params(const struct dm_vdo_target_params *vtp,
146ac4
 		valid = false;
146ac4
 	}
146ac4
 
146ac4
+	if ((vtp->max_discard < DM_VDO_MAX_DISCARD_MINIMUM) ||
146ac4
+	    (vtp->max_discard > DM_VDO_MAX_DISCARD_MAXIMUM)) {
146ac4
+		log_error("VDO max discard %u out of range.",
146ac4
+			  vtp->max_discard);
146ac4
+		valid = false;
146ac4
+	}
146ac4
+
146ac4
 	if (vtp->ack_threads > DM_VDO_ACK_THREADS_MAXIMUM) {
146ac4
 		log_error("VDO ack threads %u out of range.", vtp->ack_threads);
146ac4
 		valid = false;
146ac4
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
146ac4
index 689a9e4..b725343 100644
146ac4
--- a/lib/config/config_settings.h
146ac4
+++ b/lib/config/config_settings.h
146ac4
@@ -618,10 +618,17 @@ cfg(allocation_vdo_use_compression_CFG, "vdo_use_compression", allocation_CFG_SE
146ac4
 cfg(allocation_vdo_use_deduplication_CFG, "vdo_use_deduplication", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_USE_DEDUPLICATION, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
 	"Enables or disables deduplication when creating a VDO volume.\n"
146ac4
 	"Deduplication may be disabled in instances where data is not expected\n"
146ac4
-	"to have good deduplication rates but compression is still desired.")
146ac4
+	"to have good deduplication rates but compression is still desired.\n")
146ac4
 
146ac4
-cfg(allocation_vdo_emulate_512_sectors_CFG, "vdo_emulate_512_sectors", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_EMULATE_512_SECTORS, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
-	"Specifies that the VDO volume is to emulate a 512 byte block device.\n")
146ac4
+cfg(allocation_vdo_use_metadata_hints_CFG, "vdo_use_metadata_hints", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_USE_METADATA_HINTS, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
+	"Enables or disables whether VDO volume should tag its latency-critical\n"
146ac4
+	"writes with the REQ_SYNC flag. Some device mapper targets such as dm-raid5\n"
146ac4
+	"process writes with this flag at a higher priority.\n"
146ac4
+	"Default is enabled.\n")
146ac4
+
146ac4
+cfg(allocation_vdo_minimum_io_size_CFG, "vdo_minimum_io_size", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_MINIMUM_IO_SIZE, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
+	"The minimum IO size for VDO volume to accept, in bytes.\n"
146ac4
+	"Valid values are 512 or 4096. The recommended and default value is 4096.\n")
146ac4
 
146ac4
 cfg(allocation_vdo_block_map_cache_size_mb_CFG, "vdo_block_map_cache_size_mb", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_BLOCK_MAP_CACHE_SIZE_MB, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
 	"Specifies the amount of memory in MiB allocated for caching block map\n"
146ac4
@@ -629,41 +636,32 @@ cfg(allocation_vdo_block_map_cache_size_mb_CFG, "vdo_block_map_cache_size_mb", a
146ac4
 	"at least 128MiB and less than 16TiB. The cache must be at least 16MiB\n"
146ac4
 	"per logical thread. Note that there is a memory overhead of 15%.\n")
146ac4
 
146ac4
-cfg(allocation_vdo_block_map_period_CFG, "vdo_block_map_period", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_BLOCK_MAP_PERIOD, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
-	"Tunes the quantity of block map updates that can accumulate\n"
146ac4
-	"before cache pages are flushed to disk. The value must be\n"
146ac4
-	"at least 1 and less then 16380.\n"
146ac4
-	"A lower value means shorter recovery time but lower performance.\n")
146ac4
+// vdo format --blockMapPeriod
146ac4
+cfg(allocation_vdo_block_map_era_length_CFG, "vdo_block_map_period", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_BLOCK_MAP_ERA_LENGTH, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
+	"The speed with which the block map cache writes out modified block map pages.\n"
146ac4
+	"A smaller era length is likely to reduce the amount time spent rebuilding,\n"
146ac4
+	"at the cost of increased block map writes during normal operation.\n"
146ac4
+	"The maximum and recommended value is 16380; the minimum value is 1.\n")
146ac4
 
146ac4
 cfg(allocation_vdo_check_point_frequency_CFG, "vdo_check_point_frequency", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_CHECK_POINT_FREQUENCY, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
 	"The default check point frequency for VDO volume.\n")
146ac4
 
146ac4
+// vdo format
146ac4
 cfg(allocation_vdo_use_sparse_index_CFG, "vdo_use_sparse_index", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_USE_SPARSE_INDEX, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
 	"Enables sparse indexing for VDO volume.\n")
146ac4
 
146ac4
+// vdo format
146ac4
 cfg(allocation_vdo_index_memory_size_mb_CFG, "vdo_index_memory_size_mb", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_INDEX_MEMORY_SIZE_MB, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
 	"Specifies the amount of index memory in MiB for VDO volume.\n"
146ac4
-	"The value must be at least 256MiB and at most 1TiB.\n")
146ac4
-
146ac4
-cfg(allocation_vdo_use_read_cache_CFG, "vdo_use_read_cache", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_USE_READ_CACHE, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
-	"Enables or disables the read cache within the VDO volume.\n"
146ac4
-	"The cache should be enabled if write workloads are expected\n"
146ac4
-	"to have high levels of deduplication, or for read intensive\n"
146ac4
-	"workloads of highly compressible data.\n")
146ac4
-
146ac4
-cfg(allocation_vdo_read_cache_size_mb_CFG, "vdo_read_cache_size_mb", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_READ_CACHE_SIZE_MB, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
-	"Specifies the extra VDO volume read cache size in MiB.\n"
146ac4
-	"This space is in addition to a system-defined minimum.\n"
146ac4
-	"The value must be less then 16TiB and 1.12 MiB of memory\n"
146ac4
-	"will be used per MiB of read cache specified, per bio thread.\n")
146ac4
+	"The value must be at least 256MiB and at most 1TiB.")
146ac4
 
146ac4
 cfg(allocation_vdo_slab_size_mb_CFG, "vdo_slab_size_mb", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_SLAB_SIZE_MB, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
 	"Specifies the size in MiB of the increment by which a VDO is grown.\n"
146ac4
 	"Using a smaller size constrains the total maximum physical size\n"
146ac4
-	"that can be accommodated. Must be a power of two between 128MiB and 32GiB.\n")
146ac4
+	"that can be accommodated. Must be a power of two between 128MiB and 32GiB.")
146ac4
 
146ac4
 cfg(allocation_vdo_ack_threads_CFG, "vdo_ack_threads", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_ACK_THREADS, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
-	"Specifies the number of threads to use for acknowledging\n"
146ac4
+	"Specifies the number of threads   to use for acknowledging\n"
146ac4
 	"completion of requested VDO I/O operations.\n"
146ac4
 	"The value must be at in range [0..100].\n")
146ac4
 
146ac4
@@ -715,6 +713,16 @@ cfg(allocation_vdo_write_policy_CFG, "vdo_write_policy", allocation_CFG_SECTION,
146ac4
 	"async - Writes are acknowledged after data has been cached for writing to stable storage.\n"
146ac4
 	"        Data which has not been flushed is not guaranteed to persist in this mode.\n")
146ac4
 
146ac4
+cfg(allocation_vdo_max_discard_CFG, "vdo_max_discard", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_MAX_DISCARD, VDO_1ST_VSN, NULL, 0, NULL,
146ac4
+	"Specified te maximum size of discard bio accepted, in 4096 byte blocks.\n"
146ac4
+	"I/O requests to a VDO volume are normally split into 4096-byte blocks,\n"
146ac4
+	"and processed up to 2048 at a time. However, discard requests to a VDO volume\n"
146ac4
+	"can be automatically split to a larger size, up to <max discard> 4096-byte blocks\n"
146ac4
+	"in a single bio, and are limited to 1500 at a time.\n"
146ac4
+	"Increasing this value may provide better overall performance, at the cost of\n"
146ac4
+	"increased latency for the individual discard requests.\n"
146ac4
+	"The default and minimum is 1. The maximum is UINT_MAX / 4096.\n")
146ac4
+
146ac4
 cfg(log_report_command_log_CFG, "report_command_log", log_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED | CFG_DISALLOW_INTERACTIVE, CFG_TYPE_BOOL, DEFAULT_COMMAND_LOG_REPORT, vsn(2, 2, 158), NULL, 0, NULL,
146ac4
 	"Enable or disable LVM log reporting.\n"
146ac4
 	"If enabled, LVM will collect a log of operations, messages,\n"
146ac4
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
146ac4
index f3fcb09..3da29f0 100644
146ac4
--- a/lib/config/defaults.h
146ac4
+++ b/lib/config/defaults.h
146ac4
@@ -143,14 +143,13 @@
146ac4
 /* VDO defaults */
146ac4
 #define DEFAULT_VDO_USE_COMPRESSION	(true)
146ac4
 #define DEFAULT_VDO_USE_DEDUPLICATION	(true)
146ac4
-#define DEFAULT_VDO_EMULATE_512_SECTORS	(false)
146ac4
+#define DEFAULT_VDO_USE_METADATA_HINTS	(true)
146ac4
+#define DEFAULT_VDO_MINIMUM_IO_SIZE	(4096)
146ac4
 #define DEFAULT_VDO_BLOCK_MAP_CACHE_SIZE_MB	(DM_VDO_BLOCK_MAP_CACHE_SIZE_MINIMUM_MB)
146ac4
-#define DEFAULT_VDO_BLOCK_MAP_PERIOD	(DM_VDO_BLOCK_MAP_PERIOD_MAXIMUM)
146ac4
+#define DEFAULT_VDO_BLOCK_MAP_ERA_LENGTH (DM_VDO_BLOCK_MAP_ERA_LENGTH_MAXIMUM)
146ac4
 #define DEFAULT_VDO_USE_SPARSE_INDEX	(false)
146ac4
 #define DEFAULT_VDO_CHECK_POINT_FREQUENCY	(0)
146ac4
 #define DEFAULT_VDO_INDEX_MEMORY_SIZE_MB	(DM_VDO_INDEX_MEMORY_SIZE_MINIMUM_MB)
146ac4
-#define DEFAULT_VDO_USE_READ_CACHE	(false)
146ac4
-#define DEFAULT_VDO_READ_CACHE_SIZE_MB	(0)
146ac4
 #define DEFAULT_VDO_SLAB_SIZE_MB	(2 * 1024)  // 2GiB ... 19 slabbits
146ac4
 #define DEFAULT_VDO_ACK_THREADS		(1)
146ac4
 #define DEFAULT_VDO_BIO_THREADS		(1)
146ac4
@@ -160,6 +159,7 @@
146ac4
 #define DEFAULT_VDO_LOGICAL_THREADS	(1)
146ac4
 #define DEFAULT_VDO_PHYSICAL_THREADS	(1)
146ac4
 #define DEFAULT_VDO_WRITE_POLICY	"auto"
146ac4
+#define DEFAULT_VDO_MAX_DISCARD		(DM_VDO_MAX_DISCARD_MINIMUM)
146ac4
 
146ac4
 #define DEFAULT_VDO_FORMAT_OPTIONS_CONFIG "#S" ""
146ac4
 /*
146ac4
diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c
146ac4
index b5bbbe2..04ab1ab 100644
146ac4
--- a/lib/metadata/vdo_manip.c
146ac4
+++ b/lib/metadata/vdo_manip.c
146ac4
@@ -416,22 +416,20 @@ int fill_vdo_target_params(struct cmd_context *cmd,
146ac4
 		find_config_tree_int(cmd, allocation_vdo_use_compression_CFG, profile);
146ac4
 	vtp->use_deduplication =
146ac4
 		find_config_tree_int(cmd, allocation_vdo_use_deduplication_CFG, profile);
146ac4
-	vtp->emulate_512_sectors =
146ac4
-		find_config_tree_int(cmd, allocation_vdo_emulate_512_sectors_CFG, profile);
146ac4
+	vtp->use_metadata_hints =
146ac4
+		find_config_tree_int(cmd, allocation_vdo_use_metadata_hints_CFG, profile);
146ac4
+	vtp->minimum_io_size =
146ac4
+		find_config_tree_int(cmd, allocation_vdo_minimum_io_size_CFG, profile);
146ac4
 	vtp->block_map_cache_size_mb =
146ac4
 		find_config_tree_int64(cmd, allocation_vdo_block_map_cache_size_mb_CFG, profile);
146ac4
-	vtp->block_map_period =
146ac4
-		find_config_tree_int(cmd, allocation_vdo_block_map_period_CFG, profile);
146ac4
+	vtp->block_map_era_length =
146ac4
+		find_config_tree_int(cmd, allocation_vdo_block_map_era_length_CFG, profile);
146ac4
 	vtp->check_point_frequency =
146ac4
 		find_config_tree_int(cmd, allocation_vdo_check_point_frequency_CFG, profile);
146ac4
 	vtp->use_sparse_index =
146ac4
 		find_config_tree_int(cmd, allocation_vdo_use_sparse_index_CFG, profile);
146ac4
 	vtp->index_memory_size_mb =
146ac4
 		find_config_tree_int64(cmd, allocation_vdo_index_memory_size_mb_CFG, profile);
146ac4
-	vtp->use_read_cache =
146ac4
-		find_config_tree_int(cmd, allocation_vdo_use_read_cache_CFG, profile);
146ac4
-	vtp->read_cache_size_mb =
146ac4
-		find_config_tree_int64(cmd, allocation_vdo_read_cache_size_mb_CFG, profile);
146ac4
 	vtp->slab_size_mb =
146ac4
 		find_config_tree_int(cmd, allocation_vdo_slab_size_mb_CFG, profile);
146ac4
 	vtp->ack_threads =
146ac4
@@ -448,6 +446,8 @@ int fill_vdo_target_params(struct cmd_context *cmd,
146ac4
 		find_config_tree_int(cmd, allocation_vdo_logical_threads_CFG, profile);
146ac4
 	vtp->physical_threads =
146ac4
 		find_config_tree_int(cmd, allocation_vdo_physical_threads_CFG, profile);
146ac4
+	vtp->max_discard =
146ac4
+		find_config_tree_int(cmd, allocation_vdo_max_discard_CFG, profile);
146ac4
 
146ac4
 	policy = find_config_tree_str(cmd, allocation_vdo_write_policy_CFG, profile);
146ac4
 	if (!get_vdo_write_policy(&vtp->write_policy, policy))
146ac4
diff --git a/lib/vdo/vdo.c b/lib/vdo/vdo.c
146ac4
index 455ce5b..c34eb93 100644
146ac4
--- a/lib/vdo/vdo.c
146ac4
+++ b/lib/vdo/vdo.c
146ac4
@@ -165,21 +165,19 @@ static void _vdo_pool_display(const struct lv_segment *seg)
146ac4
 
146ac4
 	_print_yes_no("Compression\t", vtp->use_compression);
146ac4
 	_print_yes_no("Deduplication", vtp->use_deduplication);
146ac4
-	_print_yes_no("Emulate 512 sectors", vtp->emulate_512_sectors);
146ac4
+	_print_yes_no("Metadata hints", vtp->use_metadata_hints);
146ac4
 
146ac4
+	log_print("  Minimum IO size\t%s",
146ac4
+		  display_size(cmd, vtp->minimum_io_size));
146ac4
 	log_print("  Block map cache sz\t%s",
146ac4
 		  display_size(cmd, vtp->block_map_cache_size_mb * UINT64_C(2 * 1024)));
146ac4
-	log_print("  Block map period\t%u", vtp->block_map_period);
146ac4
+	log_print("  Block map era length\t%u", vtp->block_map_era_length);
146ac4
 
146ac4
 	_print_yes_no("Sparse index", vtp->use_sparse_index);
146ac4
 
146ac4
 	log_print("  Index memory size\t%s",
146ac4
 		  display_size(cmd, vtp->index_memory_size_mb * UINT64_C(2 * 1024)));
146ac4
 
146ac4
-	_print_yes_no("Using read cache", vtp->use_read_cache);
146ac4
-
146ac4
-	log_print("  Read cache size\t%s",
146ac4
-		  display_size(cmd, vtp->read_cache_size_mb * UINT64_C(2 * 1024)));
146ac4
 	log_print("  Slab size\t\t%s",
146ac4
 		  display_size(cmd, vtp->slab_size_mb * UINT64_C(2 * 1024)));
146ac4
 
146ac4
@@ -190,6 +188,7 @@ static void _vdo_pool_display(const struct lv_segment *seg)
146ac4
 	log_print("  # Hash zone threads\t%u", (unsigned) vtp->hash_zone_threads);
146ac4
 	log_print("  # Logical threads\t%u", (unsigned) vtp->logical_threads);
146ac4
 	log_print("  # Physical threads\t%u", (unsigned) vtp->physical_threads);
146ac4
+	log_print("  Max discard\t%u", (unsigned) vtp->max_discard);
146ac4
 }
146ac4
 
146ac4
 /* reused as _vdo_text_import_area_count */
146ac4
@@ -235,14 +234,17 @@ static int _vdo_pool_text_import(struct lv_segment *seg,
146ac4
 	if (!_import_bool(n, "use_deduplication", &vtp->use_deduplication))
146ac4
 		return_0;
146ac4
 
146ac4
-	if (!_import_bool(n, "emulate_512_sectors", &vtp->emulate_512_sectors))
146ac4
+	if (!_import_bool(n, "use_metadata_hints", &vtp->use_metadata_hints))
146ac4
 		return_0;
146ac4
 
146ac4
+	if (!dm_config_get_uint32(n, "minimum_io_size", &vtp->minimum_io_size))
146ac4
+		return _bad_field("minimum_io_size");
146ac4
+
146ac4
 	if (!dm_config_get_uint32(n, "block_map_cache_size_mb", &vtp->block_map_cache_size_mb))
146ac4
 		return _bad_field("block_map_cache_size_mb");
146ac4
 
146ac4
-	if (!dm_config_get_uint32(n, "block_map_period", &vtp->block_map_period))
146ac4
-		return _bad_field("block_map_period");
146ac4
+	if (!dm_config_get_uint32(n, "block_map_era_length", &vtp->block_map_era_length))
146ac4
+		return _bad_field("block_map_era_length");
146ac4
 
146ac4
 	if (!_import_bool(n, "use_sparse_index", &vtp->use_sparse_index))
146ac4
 		return_0;
146ac4
@@ -250,11 +252,8 @@ static int _vdo_pool_text_import(struct lv_segment *seg,
146ac4
 	if (!dm_config_get_uint32(n, "index_memory_size_mb", &vtp->index_memory_size_mb))
146ac4
 		return _bad_field("index_memory_size_mb");
146ac4
 
146ac4
-	if (!_import_bool(n, "use_read_cache", &vtp->use_read_cache))
146ac4
-		return_0;
146ac4
-
146ac4
-	if (!dm_config_get_uint32(n, "read_cache_size_mb", &vtp->read_cache_size_mb))
146ac4
-		return _bad_field("read_cache_size_mb");
146ac4
+	if (!dm_config_get_uint32(n, "max_discard", &vtp->max_discard))
146ac4
+		return _bad_field("max_discard");
146ac4
 
146ac4
 	if (!dm_config_get_uint32(n, "slab_size_mb", &vtp->slab_size_mb))
146ac4
 		return _bad_field("slab_size_mb");
146ac4
@@ -306,12 +305,14 @@ static int _vdo_pool_text_export(const struct lv_segment *seg, struct formatter
146ac4
 		outf(f, "use_compression = 1");
146ac4
 	if (vtp->use_deduplication)
146ac4
 		outf(f, "use_deduplication = 1");
146ac4
-	if (vtp->emulate_512_sectors)
146ac4
-		outf(f, "emulate_512_sectors = 1");
146ac4
+	if (vtp->use_metadata_hints)
146ac4
+		outf(f, "use_metadata_hints = 1");
146ac4
+
146ac4
+	outsize(f, vtp->minimum_io_size, "minimum_io_size = %u", vtp->minimum_io_size);
146ac4
 
146ac4
 	outsize(f, vtp->block_map_cache_size_mb * UINT64_C(2 * 1024),
146ac4
 		"block_map_cache_size_mb = %u", vtp->block_map_cache_size_mb);
146ac4
-	outf(f, "block_map_period = %u", vtp->block_map_period);
146ac4
+	outf(f, "block_map_era_length = %u", vtp->block_map_era_length);
146ac4
 
146ac4
 	if (vtp->use_sparse_index)
146ac4
 		outf(f, "use_sparse_index = 1");
146ac4
@@ -319,11 +320,9 @@ static int _vdo_pool_text_export(const struct lv_segment *seg, struct formatter
146ac4
 	outsize(f, vtp->index_memory_size_mb * UINT64_C(2 * 1024),
146ac4
 		"index_memory_size_mb = %u", vtp->index_memory_size_mb);
146ac4
 
146ac4
-	if (vtp->use_read_cache)
146ac4
-		outf(f, "use_read_cache = 1");
146ac4
+	outf(f, "max_discard = %u", vtp->max_discard);
146ac4
+
146ac4
 	// TODO - conditionally
146ac4
-	outsize(f, vtp->read_cache_size_mb * UINT64_C(2 * 1024),
146ac4
-		"read_cache_size_mb = %u", vtp->read_cache_size_mb);
146ac4
 	outsize(f, vtp->slab_size_mb * UINT64_C(2 * 1024),
146ac4
 		"slab_size_mb = %u", vtp->slab_size_mb);
146ac4
 	outf(f, "ack_threads = %u", (unsigned) vtp->ack_threads);
146ac4
@@ -364,7 +363,8 @@ static int _vdo_pool_add_target_line(struct dev_manager *dm,
146ac4
 
146ac4
 	/* VDO uses virtual size instead of its physical size */
146ac4
 	if (!dm_tree_node_add_vdo_target(node, get_vdo_pool_virtual_size(seg),
146ac4
-					 data_uuid, &seg->vdo_params))
146ac4
+					 data_uuid, seg_lv(seg, 0)->size,
146ac4
+					 &seg->vdo_params))
146ac4
 		return_0;
146ac4
 
146ac4
 	return 1;