From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/bees/files/, sys-fs/bees/
Date: Mon, 10 Jul 2023 03:53:21 +0000 (UTC) [thread overview]
Message-ID: <1688961175.76545a0fd15d35ad830510b7f29a0ed1cc918b94.sam@gentoo> (raw)
commit: 76545a0fd15d35ad830510b7f29a0ed1cc918b94
Author: Kai Krakow <kai <AT> kaishome <DOT> de>
AuthorDate: Sun Jul 9 10:40:09 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 10 03:52:55 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76545a0f
sys-fs/bees: Add memory fragmentation work-around
Signed-off-by: Kai Krakow <kai <AT> kaishome.de>
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/bees/bees-9999.ebuild | 14 +++++++++
...le-Work-around-kernel-memory-fragmentatio.patch | 34 ++++++++++++++++++++++
2 files changed, 48 insertions(+)
diff --git a/sys-fs/bees/bees-9999.ebuild b/sys-fs/bees/bees-9999.ebuild
index 65c3cbecea85..1b164eb56b08 100644
--- a/sys-fs/bees/bees-9999.ebuild
+++ b/sys-fs/bees/bees-9999.ebuild
@@ -29,6 +29,10 @@ RDEPEND="${DEPEND}"
CONFIG_CHECK="~BTRFS_FS"
ERROR_BTRFS_FS="CONFIG_BTRFS_FS: bees does currently only work with btrfs"
+PATCHES=(
+ "${FILESDIR}/0001-HACK-crucible-Work-around-kernel-memory-fragmentatio.patch"
+)
+
pkg_pretend() {
if [[ ${MERGE_TYPE} != buildonly ]]; then
if kernel_is -lt 4 11; then
@@ -66,6 +70,16 @@ pkg_pretend() {
ewarn "https://github.com/Zygo/bees/blob/master/docs/btrfs-kernel.md"
ewarn
fi
+ if kernel_is -gt 5 15 106; then
+ if kernel_is -lt 6 3 10; then
+ ewarn "With kernel versions 5.15.107 or later, there is a memory fragmentation"
+ ewarn "issue with LOGICAL_INO which can lead to cache thrashing and cause IO"
+ ewarn "latency spikes. This version ships with a work-around at the cost of not"
+ ewarn "handling highly duplicated filesystems that well. More details:"
+ ewarn "https://github.com/Zygo/bees/issues/260"
+ ewarn
+ fi
+ fi
elog "Bees recommends running the latest current kernel for performance and"
elog "reliability reasons, see README.md."
diff --git a/sys-fs/bees/files/0001-HACK-crucible-Work-around-kernel-memory-fragmentatio.patch b/sys-fs/bees/files/0001-HACK-crucible-Work-around-kernel-memory-fragmentatio.patch
new file mode 100644
index 000000000000..0ceb5cbfc79e
--- /dev/null
+++ b/sys-fs/bees/files/0001-HACK-crucible-Work-around-kernel-memory-fragmentatio.patch
@@ -0,0 +1,34 @@
+From 10c2006e627b5bda74f9f8aca1a574aa0e0e1eaa Mon Sep 17 00:00:00 2001
+From: Kai Krakow <kai@kaishome.de>
+Date: Sun, 9 Jul 2023 12:24:40 +0200
+Subject: [PATCH] HACK: crucible: Work around kernel memory fragmentation
+
+According to @Zygo:
+
+> This will drastically reduce the number of reflinks bees can handle
+> to a single extent, but that size is beyond more than enough for most
+> filesystems. Making the buffer smaller may also reduce the size of
+> vmallocs which might be aggravating the kernel's memory manager.
+
+Link: https://github.com/Zygo/bees/issues/260#issuecomment-1627586574
+Signed-off-by: Kai Krakow <kai@kaishome.de>
+---
+ include/crucible/fs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/crucible/fs.h b/include/crucible/fs.h
+index 6d1780b..5da7da0 100644
+--- a/include/crucible/fs.h
++++ b/include/crucible/fs.h
+@@ -65,7 +65,7 @@ namespace crucible {
+ };
+
+ struct BtrfsIoctlLogicalInoArgs {
+- BtrfsIoctlLogicalInoArgs(uint64_t logical, size_t buf_size = 16 * 1024 * 1024);
++ BtrfsIoctlLogicalInoArgs(uint64_t logical, size_t buf_size = 64 * 1024);
+
+ uint64_t get_flags() const;
+ void set_flags(uint64_t new_flags);
+--
+2.39.3
+
next reply other threads:[~2023-07-10 3:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 3:53 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-01-04 13:56 [gentoo-commits] repo/gentoo:master commit in: sys-fs/bees/files/, sys-fs/bees/ Joonas Niilola
2019-11-30 7:50 Joonas Niilola
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1688961175.76545a0fd15d35ad830510b7f29a0ed1cc918b94.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox