From 34741aa3e2ee1e67a4cc735b7492aec13f0d822c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 26 Oct 2012 20:25:36 +0200 Subject: [PATCH 1/1] journal: special case the trivial cache chain cache entry --- src/journal/journal-file.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 6c9deacf2..3df099dbd 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -1328,6 +1328,11 @@ static void chain_cache_put( uint64_t total) { if (!ci) { + /* If the chain item to cache for this chain is the + * first one it's not worth caching anything */ + if (array == first) + return; + if (hashmap_size(h) >= CHAIN_CACHE_MAX) ci = hashmap_steal_first(h); else { -- 2.30.2