From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 987C515800D for ; Mon, 10 Jul 2023 03:53:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E00C2E0885; Mon, 10 Jul 2023 03:53:23 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C4516E086F for ; Mon, 10 Jul 2023 03:53:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D3167340F5F for ; Mon, 10 Jul 2023 03:53:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4B0A5AC2 for ; Mon, 10 Jul 2023 03:53:21 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1688961175.76545a0fd15d35ad830510b7f29a0ed1cc918b94.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/bees/files/, sys-fs/bees/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-fs/bees/bees-9999.ebuild sys-fs/bees/files/0001-HACK-crucible-Work-around-kernel-memory-fragmentatio.patch X-VCS-Directories: sys-fs/bees/ sys-fs/bees/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 76545a0fd15d35ad830510b7f29a0ed1cc918b94 X-VCS-Branch: master Date: Mon, 10 Jul 2023 03:53:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f98ded19-c92a-4ca1-89bc-80f36e3b9459 X-Archives-Hash: 309a93246bd8a3c469a2a6c3171bf9bc commit: 76545a0fd15d35ad830510b7f29a0ed1cc918b94 Author: Kai Krakow kaishome de> AuthorDate: Sun Jul 9 10:40:09 2023 +0000 Commit: Sam James gentoo 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 kaishome.de> Signed-off-by: Sam James 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 +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 +--- + 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 +