]> git.ipfire.org Git - thirdparty/systemd.git/commit
fs-util: increase start buffer size in readlinkat_malloc()
authorLennart Poettering <lennart@poettering.net>
Thu, 25 Oct 2018 19:16:47 +0000 (21:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Oct 2018 19:37:14 +0000 (21:37 +0200)
commit8e060ec225b74bbf22e5bdbacd604efcc73294c0
tree75e2481122c22bcfb700cdc8056ce45a590affa5
parent05f339267ed3f3c5f2e461ffbe2630e7e99d9a49
fs-util: increase start buffer size in readlinkat_malloc()

I noticed while profiling journald that we invoke readlinkat() a ton on
open /proc/self/fd/<fd>, and that the returned paths are more often than
not longer than the 99 chars used before, when we look at archived
journal files. This means for these cases we generally need to execute
two rather than one syscalls.

Let's increase the buffer size a tiny bit, so that we reduce the number
of syscalls executed. This is really a low-hanging fruit of
optimization.
src/basic/fs-util.c