]> git.hungrycats.org Git - bees/commitdiff
context: reduce the size of LOGICAL_INO buffers
authorZygo Blaxell <bees@furryterror.org>
Mon, 17 Jul 2023 21:49:21 +0000 (17:49 -0400)
committerZygo Blaxell <bees@furryterror.org>
Thu, 18 Apr 2024 03:14:35 +0000 (23:14 -0400)
Since we'll never process more than BEES_MAX_EXTENT_REF_COUNT extent
references by definition, it follows that we should not allocate buffer
space for them when we perform the LOGICAL_INO ioctl.

There is some evidence (particularly
https://github.com/Zygo/bees/issues/260#issuecomment-1627598058) that
the kernel is subjecting the page cache to a lot of disruption when
trying allocate large buffers for LOGICAL_INO.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
src/bees-context.cc

index 36cccc9c718d80e278db908bd50525e1979579db..09ec15219d2c6aeeb3929c3fdcbdfab4e2dd3c90 100644 (file)
@@ -925,7 +925,8 @@ BeesContext::start()
                return make_shared<BeesTempFile>(shared_from_this());
        });
        m_logical_ino_pool.generator([]() {
-               return make_shared<BtrfsIoctlLogicalInoArgs>(0);
+               const auto extent_ref_size = sizeof(uint64_t) * 3;
+               return make_shared<BtrfsIoctlLogicalInoArgs>(0, BEES_MAX_EXTENT_REF_COUNT * extent_ref_size + sizeof(btrfs_data_container));
        });
        m_tmpfile_pool.checkin([](const shared_ptr<BeesTempFile> &btf) {
                catch_all([&](){