diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-02-06 05:42:43 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-02-06 05:42:43 +0000 |
commit | 9e0addc1cf71ebec277b59e38eb3fa30e650cf9f (patch) | |
tree | fad7eaf86ed6caf32c2c6e1b52157364ec9a79f6 /sys-fs/zfs-kmod | |
parent | d82c6c919aa63b46ec1683492b75162951f09072 (diff) |
gentoo auto-resync : 06:02:2024 - 05:42:43
Diffstat (limited to 'sys-fs/zfs-kmod')
-rw-r--r-- | sys-fs/zfs-kmod/Manifest | 2 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch | 31 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/zfs-kmod-2.2.2-r1.ebuild | 219 |
3 files changed, 252 insertions, 0 deletions
diff --git a/sys-fs/zfs-kmod/Manifest b/sys-fs/zfs-kmod/Manifest index 452125878960..7be3fa75b1c6 100644 --- a/sys-fs/zfs-kmod/Manifest +++ b/sys-fs/zfs-kmod/Manifest @@ -1,10 +1,12 @@ AUX zfs-kmod-2.1.11-gentoo.patch 1076 BLAKE2B d2b0fe2ff1ac31c2a2a184141f107010dae61d2de465462b8177db1a07918be2bd2fc4d4570ad8758da87ef14cf3878db062fe9eb5b53fa3156e7db5c06073d4 SHA512 9e103aae75036e52f89e79c4d4ed3cffe670ef423cda7c2f936533b9329e994c7a02d241289f6565e9d086e5b0bdd6865ab3677c3ad84eaadf3abe310977b6a8 AUX zfs-kmod-2.2.2-arm64-neon.patch 3145 BLAKE2B 6125fd18649341e44768a84a508cf6d59db72356ebf513fbfb56b50e4fcc9052cee0e315d448e22067b5458336efa3897557dc2cc4ed8b6ef4dda75e0db3e2e0 SHA512 a238df628397fc72e604ec163401865f8348f121bbffac119f5b094ce06318f89fbfb30a1e424ac4835348df67e2512ee05ae5007ee765dc3876d3ba30cdd99d +AUX zfs-kmod-2.2.2-autotrim.patch 1186 BLAKE2B 4dcc5eead0b86fa365ed2c228ac1c0b01f89cc36210959c55d5bf06d1b4e739d6e8a0dee3910ae0c08d7859b3c05cf483aec29d5184d3725cfc66419a943c336 SHA512 cf0d10b00ea045184966424474307a00ff95a96a4c0ea8e7e1037b1b101c2e9d6e2a4b52851427031bcba7ef7ff0d71b90d074f33385166d447896b41771396e DIST zfs-2.1.14.tar.gz 35167471 BLAKE2B a7b22eaf05e4fbf416ebe4d7b884c515942fc9375c1dd322cefa00c19c550b9318a4192d6a909d49d58523c8f1a6eaf00189dd58e6543fae17cf8cc35042f469 SHA512 4a65c8b7d5576fa2dcc14e7ccaa93191c1d3791479cf89bd02c2bd04434ff5e93709b328796d4f9ba93da19f12772e359df373f40919350a3e1e4c52758b47c8 DIST zfs-2.1.14.tar.gz.asc 836 BLAKE2B f01bc58bf6c3d367c494ed4ea9f3fb1141f3aafdbf4f913b9e0d60d31557076d5ae0e25ca93b013f5fd85e21ba5ae9f61e1a03af54bb0c743869c0ce3d5519df SHA512 be0f386cce952b4047dc2448e356078668e8d4392802dd3bb1a426741f15f4d9fb689cd1cb09972bdbc9fe2e4e782ec4b4754fe811c5657bc1f5308bd38e3926 DIST zfs-2.2.2.tar.gz 33816541 BLAKE2B f0619ae42d898d18077096217d0a9ddd7c7378424707aa51d3645661b2889a1459bc4a5e9fe42b6860b2d26e4600da35765b0e741725dafacc2ead2370cad866 SHA512 bba252cbf7986f2cce154dd18a34aa478cf98f70106337188dc894de2446d60a58fa643706927757d1787506b44d4ff404897a2d0e16aacb0a7bf27765703332 DIST zfs-2.2.2.tar.gz.asc 836 BLAKE2B bdc86492b2bf45d329e34e89ea7796f5cbf518d32ab114c909321b1d0d8040b9ce4e25b3b85fcbc5ea62ee10a2d716b5b27e37c2c005b307c0b593815c49d625 SHA512 110be1aa90f4749106717165a3cb5116379e2d170146a2b3d2601f04212450da9327e028d6e1e5de7f8a46c6bb7a15e2bcdd09e3e760590fbc695f9562f1440b EBUILD zfs-kmod-2.1.14.ebuild 4601 BLAKE2B 451f240a8bfda7164ee48ae37bb410b8c3e06ca7184126da122258e7f6f8da62d23c9e6b0481e310735d92e460fbe5617a9f01da04cdb0ae801039c93cb12cd7 SHA512 7240287b57eaac31f6d0c7d4994c6a4de44a41ac9470aeb4c95e33ddb9557d7c70fad24c037f32ae026b4b7bb745ec5f4f496a802457dbdb95a8f1ec7f527c49 +EBUILD zfs-kmod-2.2.2-r1.ebuild 6025 BLAKE2B c0f21b6c1a70b1f664700ec4a85be54d8ef15f2dec828b977f6d52ee9ed2f6468454d6ac161f70e97d49fdcc0b4799ffc56cae137cac8be65a2e7c1a1b42626a SHA512 afc32eef22464550c1097ce60df52c45288ca90509cab45809c763eb5903cdc510dfcc3c53b4d8ff4711cc3e611bc3125426bb692d5f9357a31329e973db8c2f EBUILD zfs-kmod-2.2.2.ebuild 5980 BLAKE2B 7db333fae56ed3306ef21b8adb9172ef056367c339d6bf57e43ab15d6f48888a84c31c317dfc46b757498aacf7f83c2b47436658cbcb6515b78b003c7f806611 SHA512 3da30083362ba3bb9b52d0b6cf3b5874ecacd0c6f208cb86c3b98997905a00d66cd59b8593c9732ff94aafad57c097cad65b3f78d26a803d985758a79d2e9d86 EBUILD zfs-kmod-9999.ebuild 5939 BLAKE2B 880f2d7d9caefc7c02a16662ea7f57f2c7315527b100159c4c1f65f13cd54bd13ce6fdf137fbf70c80531abc6cfe92b4854a5bc3a72b74b073b70b18552102aa SHA512 5c1e74764724963d200b40e95fbe30ea478c07c82be939f509651ed6d0c4cde86634a9e41d8ff854f23ae432a8d755c4455f9f8cd0d41ee8ec3a8cd50691603d MISC metadata.xml 776 BLAKE2B 4c48182f7ceee679b4d947a70cb232980969b59bdc425463a929b6ae8be5f79450a3869bf3cc4d00069b65cda8a06f42eba29a7974c5e1b34a2998992901bcbe SHA512 f3f0af7dcdd26a01fc1b00af46ff64e7e6d7bb83a2225ea4cbff5c1a56651ddfdf3e7f59af914833f52828b9d059c6a8cb7f32037319abed129c40987349745f diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch b/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch new file mode 100644 index 000000000000..6d72389fdb25 --- /dev/null +++ b/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch @@ -0,0 +1,31 @@ +https://bugs.gentoo.org/923745 +https://github.com/openzfs/zfs/issues/15453 +https://github.com/openzfs/zfs/pull/15781 +https://github.com/openzfs/zfs/pull/15789 + +From a0aa7a2ee3b56d7b6d69c2081034ec8293a6d605 Mon Sep 17 00:00:00 2001 +From: Kevin Jin <33590050+jxdking@users.noreply.github.com> +Date: Wed, 17 Jan 2024 12:03:58 -0500 +Subject: [PATCH] Autotrim High Load Average Fix + +Switch from cv_wait() to cv_wait_idle() in vdev_autotrim_wait_kick(), +which should mitigate the high load average while waiting. + +Reviewed-by: Brian Atkinson <batkinson@lanl.gov> +Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> +Reviewed-by: Alexander Motin <mav@FreeBSD.org> +Signed-off-by: jxdking <lostking2008@hotmail.com> +Closes #15781 +--- a/module/zfs/vdev_trim.c ++++ b/module/zfs/vdev_trim.c +@@ -194,7 +194,8 @@ vdev_autotrim_wait_kick(vdev_t *vd, int num_of_kick) + for (int i = 0; i < num_of_kick; i++) { + if (vd->vdev_autotrim_exit_wanted) + break; +- cv_wait(&vd->vdev_autotrim_kick_cv, &vd->vdev_autotrim_lock); ++ cv_wait_idle(&vd->vdev_autotrim_kick_cv, ++ &vd->vdev_autotrim_lock); + } + boolean_t exit_wanted = vd->vdev_autotrim_exit_wanted; + mutex_exit(&vd->vdev_autotrim_lock); + diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.2.2-r1.ebuild b/sys-fs/zfs-kmod/zfs-kmod-2.2.2-r1.ebuild new file mode 100644 index 000000000000..7b28bf3a94ab --- /dev/null +++ b/sys-fs/zfs-kmod/zfs-kmod-2.2.2-r1.ebuild @@ -0,0 +1,219 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools dist-kernel-utils flag-o-matic linux-mod-r1 multiprocessing + +DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" +HOMEPAGE="https://github.com/openzfs/zfs" + +MODULES_KERNEL_MAX=6.6 +MODULES_KERNEL_MIN=3.10 + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://github.com/openzfs/zfs.git" + inherit git-r3 + unset MODULES_KERNEL_MAX +else + VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/openzfs.asc + inherit verify-sig + + MY_PV=${PV/_rc/-rc} + SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz" + SRC_URI+=" verify-sig? ( https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz.asc )" + S="${WORKDIR}/zfs-${MY_PV}" + + ZFS_KERNEL_COMPAT="${MODULES_KERNEL_MAX}" + # Increments minor eg 5.14 -> 5.15, and still supports override. + ZFS_KERNEL_DEP="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}" + ZFS_KERNEL_DEP="${ZFS_KERNEL_DEP%%.*}.$(( ${ZFS_KERNEL_DEP##*.} + 1))" + + if [[ ${PV} != *_rc* ]] ; then + KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~sparc" + fi +fi + +LICENSE="CDDL MIT debug? ( GPL-2+ )" +SLOT="0/${PVR}" +IUSE="custom-cflags debug +rootfs" +RESTRICT="test" + +BDEPEND=" + app-alternatives/awk + dev-lang/perl +" + +if [[ ${PV} != 9999 ]] ; then + BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" + + IUSE+=" +dist-kernel-cap" + RDEPEND=" + dist-kernel-cap? ( dist-kernel? ( + <virtual/dist-kernel-${ZFS_KERNEL_DEP} + ) ) + " +fi + +# Used to suggest matching USE, but without suggesting to disable +PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )" + +PATCHES=( + "${FILESDIR}"/${PN}-2.1.11-gentoo.patch + "${FILESDIR}"/${PN}-2.2.2-arm64-neon.patch + "${FILESDIR}"/${PN}-2.2.2-autotrim.patch +) + +pkg_pretend() { + use rootfs || return 0 + + if has_version virtual/dist-kernel && ! use dist-kernel; then + ewarn "You have virtual/dist-kernel installed, but" + ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}" + ewarn "It's recommended to globally enable dist-kernel USE flag" + ewarn "to auto-trigger initrd rebuilds with kernel updates" + fi +} + +pkg_setup() { + local CONFIG_CHECK=" + EFI_PARTITION + ZLIB_DEFLATE + ZLIB_INFLATE + !DEBUG_LOCK_ALLOC + !PAX_KERNEXEC_PLUGIN_METHOD_OR + " + use debug && CONFIG_CHECK+=" + DEBUG_INFO + FRAME_POINTER + !DEBUG_INFO_REDUCED + " + use rootfs && CONFIG_CHECK+=" + BLK_DEV_INITRD + DEVTMPFS + " + + kernel_is -lt 5 && CONFIG_CHECK+=" IOSCHED_NOOP" + + if [[ ${PV} != 9999 ]] ; then + local kv_major_max kv_minor_max zcompat + zcompat="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}" + kv_major_max="${zcompat%%.*}" + zcompat="${zcompat#*.}" + kv_minor_max="${zcompat%%.*}" + kernel_is -le "${kv_major_max}" "${kv_minor_max}" || die \ + "Linux ${kv_major_max}.${kv_minor_max} is the latest supported version" + fi + + linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + # Run unconditionally (bug #792627) + eautoreconf + + if [[ ${PV} != 9999 ]] ; then + # Set module revision number + sed -Ei "s/(Release:.*)1/\1${PR}-gentoo/" META || die + fi +} + +src_configure() { + use custom-cflags || strip-flags + filter-ldflags -Wl,* + + local myconf=( + --bindir="${EPREFIX}"/bin + --sbindir="${EPREFIX}"/sbin + --with-config=kernel + --with-linux="${KV_DIR}" + --with-linux-obj="${KV_OUT_DIR}" + $(use_enable debug) + + # See gentoo.patch + GENTOO_MAKEARGS_EVAL="${MODULES_MAKEARGS[*]@Q}" + TEST_JOBS="$(makeopts_jobs)" + ) + + econf "${myconf[@]}" +} + +src_compile() { + emake "${MODULES_MAKEARGS[@]}" +} + +src_install() { + emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install + modules_post_process + + dodoc AUTHORS COPYRIGHT META README.md +} + +_old_layout_cleanup() { + # new files are just extra/{spl,zfs}.ko with no subdirs. + local olddir=( + avl/zavl + icp/icp + lua/zlua + nvpair/znvpair + spl/spl + unicode/zunicode + zcommon/zcommon + zfs/zfs + zstd/zzstd + ) + + # kernel/module/Kconfig contains possible compressed extentions. + local kext kextfiles + for kext in .ko{,.{gz,xz,zst}}; do + kextfiles+=( "${olddir[@]/%/${kext}}" ) + done + + local oldfile oldpath + for oldfile in "${kextfiles[@]}"; do + oldpath="${EROOT}/lib/modules/${KV_FULL}/extra/${oldfile}" + if [[ -f "${oldpath}" ]]; then + ewarn "Found obsolete zfs module ${oldfile} for current kernel ${KV_FULL}, removing." + rm -rv "${oldpath}" || die + # we do not remove non-empty directories just for safety in case there's something else. + # also it may fail if there are both compressed and uncompressed modules installed. + rmdir -v --ignore-fail-on-non-empty "${oldpath%/*.*}" || die + fi + done +} + +pkg_postinst() { + # Check for old module layout before doing anything else. + # only attempt layout cleanup if new .ko location is used. + local newko=( "${EROOT}/lib/modules/${KV_FULL}/extra"/{zfs,spl}.ko* ) + # We check first array member, if glob above did not exand, it will be "zfs.ko*" and -f will return false. + # if glob expanded -f will do correct file precense check. + [[ -f ${newko[0]} ]] && _old_layout_cleanup + + linux-mod-r1_pkg_postinst + + if [[ -z ${ROOT} ]] && use dist-kernel ; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" + fi + + if use x86 || use arm ; then + ewarn "32-bit kernels will likely require increasing vmalloc to" + ewarn "at least 256M and decreasing zfs_arc_max to some value less than that." + fi + + if has_version sys-boot/grub ; then + ewarn "This version of OpenZFS includes support for new feature flags" + ewarn "that are incompatible with previous versions. GRUB2 support for" + ewarn "/boot with the new feature flags is not yet available." + ewarn "Do *NOT* upgrade root pools to use the new feature flags." + ewarn "Any new pools will be created with the new feature flags by default" + ewarn "and will not be compatible with older versions of OpenZFS. To" + ewarn "create a new pool that is backward compatible wih GRUB2, use " + ewarn + ewarn "zpool create -o compatibility=grub2 ..." + ewarn + ewarn "Refer to /usr/share/zfs/compatibility.d/grub2 for list of features." + fi +} |