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

hash: raise hash table size

With slightly bigger hash tables, there is considerable
less hash collisions.
This commit is contained in:
Zdenek Kabelac 2021-12-17 16:36:36 +01:00
parent ed1651d11f
commit 09a4b56895
4 changed files with 4 additions and 3 deletions

View File

@ -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
===================================

View File

@ -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;
}

View File

@ -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);

View File

@ -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;