Skip to content

Commit

Permalink
context: reduce the size of LOGICAL_INO buffers
Browse files Browse the repository at this point in the history
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
#260 (comment)) 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 <[email protected]>
  • Loading branch information
Zygo Blaxell committed Apr 18, 2024
1 parent cfb7592 commit 75131f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bees-context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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([&](){
Expand Down

0 comments on commit 75131f3

Please sign in to comment.