1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cache: select chunk size as power of 2

When cache chunk size is not configured, and left for lvm deduction,
select the value which is power-of-2.
This commit is contained in:
Zdenek Kabelac 2019-01-28 20:08:49 +01:00
parent cbf62b9262
commit 58ad831c72
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.03.02 - Version 2.03.02 -
=================================== ===================================
Cache selects power-of-2 chunk size by default.
Support reszing for VDOPoolLV and VDOLV. Support reszing for VDOPoolLV and VDOLV.
Improve -lXXX%VG modifier which improves cache segment estimation. Improve -lXXX%VG modifier which improves cache segment estimation.
Ensure migration_threshold for cache is at least 8 chunks. Ensure migration_threshold for cache is at least 8 chunks.

View File

@ -215,9 +215,12 @@ int update_cache_pool_params(struct cmd_context *cmd,
if (!*chunk_size) { if (!*chunk_size) {
if (!(*chunk_size = find_config_tree_int(cmd, allocation_cache_pool_chunk_size_CFG, if (!(*chunk_size = find_config_tree_int(cmd, allocation_cache_pool_chunk_size_CFG,
profile) * 2)) profile) * 2)) {
*chunk_size = get_default_allocation_cache_pool_chunk_size_CFG(cmd, *chunk_size = get_default_allocation_cache_pool_chunk_size_CFG(cmd,
profile); profile);
/* Use power-of-2 for min chunk size when unspecified */
min_chunk_size = 1 << (32 - clz(min_chunk_size - 1));
}
if (*chunk_size < min_chunk_size) { if (*chunk_size < min_chunk_size) {
/* /*
* When using more then 'standard' default, * When using more then 'standard' default,