]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
MDS/CDir: return as early as possible from CDir::should_split_fast() 60236/head
authorMax Kellermann <max.kellermann@ionos.com>
Thu, 10 Oct 2024 07:31:53 +0000 (09:31 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Fri, 18 Oct 2024 07:49:40 +0000 (09:49 +0200)
commit27feea13ff0fe9690bc099e3692ffbd5db5e51e4
tree2fff07c5c656ac3dc6c4fa6df6a22929f7708659
parentc5faa93d2696af5c9c4f130b73e6e13e30e206d7
MDS/CDir: return as early as possible from CDir::should_split_fast()

All we want to know is whether we're above the `fast_limit`; if we're
above that, we don't need to know how many exactly.

By returning early instead of iterating over all entries, a lot of CPU
time can be saved.  In a microbenchmark where `fio` was used to create
thousands of files, the CPU usage of `CDir::should_split_fast()` went
from 6% to less than 1% in the `perf report`.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/mds/CDir.cc