main - hash: raise hash table size
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=09a4b56895b959f46a9b7e7af11732d8e1bbf945 Commit: 09a4b56895b959f46a9b7e7af11732d8e1bbf945 Parent: ed1651d11f42ea7157b7b0aebf498b97e56b98aa Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Dec 17 16:36:36 2021 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Dec 20 16:13:28 2021 +0100
hash: raise hash table size
With slightly bigger hash tables, there is considerable less hash collisions.
--- WHATS_NEW | 1 + lib/config/config.c | 2 +- lib/device/dev-cache.c | 2 +- lib/filters/filter-persistent.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.03.15 - =================================== + Increase some hash table size to better support large device sets. Version 2.03.14 - 20th October 2021 ===================================
lib/config/config.c +1 -1
@@ -1167,7 +1167,7 @@ int config_def_check(struct cft_check_handle *handle) *vp =0 ; *rp =0 ;if (!handle->cmd->cft_def_hash) { -if (!(handle->cmd->cft_def_hash =dm_hash_create (60 ))) { +if (!(handle->cmd->cft_def_hash =dm_hash_create (500 ))) {log_error ("Failed to create configuration definition hash." ); r =0 ; goto out; }
lib/device/dev-cache.c +1 -1
@@ -1246,7 +1246,7 @@ int dev_cache_init(struct cmd_context *cmd)if (!(_cache.mem =dm_pool_create ("dev_cache" ,10 *1024 ))) return_0; -if (!(_cache.names =dm_hash_create (120 )) || +if (!(_cache.names =dm_hash_create (1020 )) || !(_cache.vgid_index =dm_hash_create (30 )) || !(_cache.lvid_index =dm_hash_create (29 ))) {dm_pool_destroy (_cache.mem);
lib/filters/filter-persistent.c +1 -1
@@ -58,7 +58,7 @@ static int _init_hash(struct pfilter *pf)if (pf->devices)dm_hash_destroy (pf->devices); -if (!(pf->devices =dm_hash_create (111 ))) +if (!(pf->devices =dm_hash_create (511 ))) return_0;return 1 ;