]> sourceware.org Git - lvm2.git/commitdiff
hash: increase some default hash table size
authorZdenek Kabelac <zkabelac@redhat.com>
Sat, 25 May 2024 22:33:16 +0000 (00:33 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 27 May 2024 13:35:57 +0000 (15:35 +0200)
Size of these hashes was quite small, so raise the size of
hashed entries to reduce amount of hash collistion.
Select some unique/unused number for hash_create below 8192.

lib/device/dev-cache.c
lib/filters/filter-persistent.c

index c4fdbe1fcc990ec7520342a9b6040095b75141e2..a816eb19a1e418fb444974dba32f464d7cd2afef 100644 (file)
@@ -1311,7 +1311,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(1020)) ||
+       if (!(_cache.names = dm_hash_create(8190)) ||
            !(_cache.vgid_index = dm_hash_create(30)) ||
            !(_cache.lvid_index = dm_hash_create(29))) {
                dm_pool_destroy(_cache.mem);
index 212a5c1836b6cc1cbd2b7f0e575261d84a8a9203..7b20ff1d1bb000ea261cbfbef108e55bd18ab0ad 100644 (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(511)))
+       if (!(pf->devices = dm_hash_create(8191)))
                return_0;
 
        return 1;
This page took 0.03768 seconds and 5 git commands to generate.