chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c2a623d
)
journal: estimate data hash table size a bit larger by default
author
Lennart Poettering
<lennart@poettering.net>
Wed, 18 Jul 2012 14:22:25 +0000
(16:22 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 18 Jul 2012 14:22:25 +0000
(16:22 +0200)
src/journal/journal-file.c
patch
|
blob
|
history
diff --git
a/src/journal/journal-file.c
b/src/journal/journal-file.c
index d8ce495d86d0146be274bec804d8d4b98082e0b8..b9ab009b3f732ce3cf1f9e74b8920053590eb1d1 100644
(file)
--- a/
src/journal/journal-file.c
+++ b/
src/journal/journal-file.c
@@
-510,16
+510,16
@@
static int journal_file_setup_data_hash_table(JournalFile *f) {
assert(f);
assert(f);
- /* We estimate that we need 1 hash table entry per
2K
of
+ /* We estimate that we need 1 hash table entry per
768
of
journal file and we want to make sure we never get beyond
75% fill level. Calculate the hash table size for the
maximum file size based on these metrics. */
journal file and we want to make sure we never get beyond
75% fill level. Calculate the hash table size for the
maximum file size based on these metrics. */
- s = (f->metrics.max_size * 4 /
204
8 / 3) * sizeof(HashItem);
+ s = (f->metrics.max_size * 4 /
76
8 / 3) * sizeof(HashItem);
if (s < DEFAULT_DATA_HASH_TABLE_SIZE)
s = DEFAULT_DATA_HASH_TABLE_SIZE;
if (s < DEFAULT_DATA_HASH_TABLE_SIZE)
s = DEFAULT_DATA_HASH_TABLE_SIZE;
- log_info("Reserving %llu entries in hash table.", (unsigned long long)
s
);
+ log_info("Reserving %llu entries in hash table.", (unsigned long long)
(s / sizeof(HashItem))
);
r = journal_file_append_object(f,
OBJECT_DATA_HASH_TABLE,
r = journal_file_append_object(f,
OBJECT_DATA_HASH_TABLE,