master - pool: Make another thin pool fn generic for cache usage also
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=324781953178ed9787257334a73d93e731add0c4 Commit: 324781953178ed9787257334a73d93e731add0c4 Parent: 131383963ff7cc9b101b9a80a8e495473ccec4cf Author: Jonathan Brassow <[email protected]> AuthorDate: Tue Feb 4 07:03:52 2014 -0600 Committer: Jonathan Brassow <[email protected]> CommitterDate: Tue Feb 4 07:03:52 2014 -0600
pool: Make another thin pool fn generic for cache usage also
Make '_recalculate_thin_pool_chunk_size_with_dev_hints' so it can be used for cache and thin pools.
--- conf/example.conf.in | 11 +++++++++ lib/config/config_settings.h | 3 ++ lib/config/defaults.h | 1 + lib/metadata/lv_manip.c | 52 +++++++++++++++++++++++++++++------------- libdm/libdevmapper.h | 16 +++++++++++++ 5 files changed, 67 insertions(+), 16 deletions(-)
conf/example.conf.in +11 -0
@@ -305,6 +305,17 @@ allocation { # placed on different PVs from the cache_pool data. cache_pool_metadata_require_separate_pvs = 0 + # Specify the minimal chunk size (in kiB) for cache pool volumes. + # Using a chunk_size that is too large can result in wasteful use of + # the cache, where small reads and writes can cause large sections of + # an LV to be mapped into the cache. However, choosing a chunk_size + # that is too small can result in more overhead trying to manage the + # numerous chunks that become mapped into the cache. The former is + # more of a problem than the latter in most cases, so we default to + # a value that is on the smaller end of the spectrum. Supported values + # range from 32(kiB) to 1048576 in multiples of 32. + # cache_pool_chunk_size = 64 + # Set to 1 to guarantee that thin pool metadata will always # be placed on different PVs from the pool data. thin_pool_metadata_require_separate_pvs = 0
lib/config/config_settings.h +3 -0
@@ -107,7 +107,10 @@ cfg(allocation_maximise_cling_CFG, "maximise_cling", allocation_CFG_SECTION, 0, cfg(allocation_use_blkid_wiping_CFG, "use_blkid_wiping", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, 1, vsn(2, 2, 105), NULL) cfg(allocation_wipe_signatures_when_zeroing_new_lvs_CFG, "wipe_signatures_when_zeroing_new_lvs", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, 1, vsn(2, 2, 105), NULL) cfg(allocation_mirror_logs_require_separate_pvs_CFG, "mirror_logs_require_separate_pvs", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_MIRROR_LOGS_REQUIRE_SEPARATE_PVS, vsn(2, 2, 85), NULL) + cfg(allocation_cache_pool_metadata_require_separate_pvs_CFG, "cache_pool_metadata_require_separate_pvs", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_CACHE_POOL_METADATA_REQUIRE_SEPARATE_PVS, vsn(2, 2, 106), NULL) +cfg(allocation_cache_pool_chunk_size_CFG, "cache_pool_chunk_size", allocation_CFG_SECTION, 0, CFG_TYPE_INT, 0, vsn(2, 2, 106), NULL) + cfg(allocation_thin_pool_metadata_require_separate_pvs_CFG, "thin_pool_metadata_require_separate_pvs", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS, vsn(2, 2, 89), NULL) cfg(allocation_thin_pool_zero_CFG, "thin_pool_zero", allocation_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_THIN_POOL_ZERO, vsn(2, 2, 99), NULL)cfg (allocation_thin_pool_discards_CFG,"thin_pool_discards" , allocation_CFG_SECTION,CFG_PROFILABLE ,CFG_TYPE_STRING ,DEFAULT_THIN_POOL_DISCARDS ,vsn (2 ,2 ,99 ),NULL )
lib/config/defaults.h +1 -0
@@ -80,6 +80,7 @@#define DEFAULT_POOL_METADATA_SPARE 1#define DEFAULT_CACHE_POOL_METADATA_REQUIRE_SEPARATE_PVS 0 +#define DEFAULT_CACHE_POOL_CHUNK_SIZE 64/* KB */ #define DEFAULT_UMASK 0077
lib/metadata/lv_manip.c +36 -16
83 lines not on this page · raw message
libdm/libdevmapper.h +16 -0
@@ -715,6 +715,22 @@ int dm_tree_node_add_raid_target(struct dm_tree_node *node,uint64_t rebuilds, uint64_t flags); +/* +* Defines bellow are based on kernel's dm-cache.c defines +* DM_CACHE_MIN_DATA_BLOCK_SIZE (32 * 1024 >> SECTOR_SHIFT) +* DM_CACHE_MAX_DATA_BLOCK_SIZE (1024 * 1024 * 1024 >> SECTOR_SHIFT) +*/ +#define DM_CACHE_MIN_DATA_BLOCK_SIZE (UINT32_C(64)) +#define DM_CACHE_MAX_DATA_BLOCK_SIZE (UINT32_C(2097152)) +/* +* Max supported size for cache pool metadata device. +* Limitation is hardcoded into the kernel and bigger device sizes +* are not accepted. +* +* Limit defined in drivers/md/dm-cache-metadata.h +*/ +#define DM_CACHE_METADATA_MAX_SECTORS DM_THIN_METADATA_MAX_SECTORS +struct dm_tree_node_raid_params {const char *raid_type;