mmap-cache: enforce an unused windows minimum
authorVito Caputo <vcaputo@pengaru.com>
Sat, 21 Sep 2024 19:30:49 +0000 (12:30 -0700)
committerVito Caputo <vcaputo@pengaru.com>
Sat, 21 Sep 2024 22:27:58 +0000 (15:27 -0700)
commit176f73272e6e3116caab3900eb553be54f520a68
tree22d3b113c7d9f662094e560a5f7529f131274b90
parent0a40325573b91ea71070653865f7f6a9cada2bef
mmap-cache: enforce an unused windows minimum

With many fds the global windows count generally exceeds the
minimum.   This results in always reusing the unused entry if
there is one, which becomes a sort of degenerate case where we're
just constantly unmapping->mapping.

Instead let's try always have at least several unused windows on
the unused list before we resort to churning through it.

Fixes #34516
src/libsystemd/sd-journal/mmap-cache.c