commit: 9aa71a984be6a957937320d37234e19c5d81eb12 Author: Brahmajit Das <listout <AT> listout <DOT> xyz> AuthorDate: Sat Jan 3 08:44:12 2026 +0000 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> CommitDate: Mon Jan 5 16:33:45 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9aa71a98
sys-kernel/zen-sources: add 6.18.3 Signed-off-by: Brahmajit Das <listout <AT> listout.xyz> Part-of: https://github.com/gentoo/gentoo/pull/45236 Closes: https://github.com/gentoo/gentoo/pull/45236 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> sys-kernel/zen-sources/Manifest | 3 + .../0001-sched-proxy-Yield-the-donor-task.patch | 119 +++++++++++++++++++++ sys-kernel/zen-sources/zen-sources-6.18.3.ebuild | 66 ++++++++++++ 3 files changed, 188 insertions(+) diff --git a/sys-kernel/zen-sources/Manifest b/sys-kernel/zen-sources/Manifest index 0637a953ca4b..397d7c03cf08 100644 --- a/sys-kernel/zen-sources/Manifest +++ b/sys-kernel/zen-sources/Manifest @@ -1,4 +1,7 @@ DIST genpatches-6.18-3.base.tar.xz 210740 BLAKE2B 57beb2179632cfea1af1750b18b060605fcc3ad524d214d4b6c27a4814e38e478e073430214e57ec110ff93f9c63eb12e11cf82cc287f671e6348e912e3218ff SHA512 668f56e01f4cf69d7014c81d411b6ab7ac748a15d854a2e8ed28a7e87deb28193b836f5510abb32ba75fcfdb558f73c1dbda8bcd6e0f5bd943e6df3775ac17da DIST genpatches-6.18-3.extras.tar.xz 4324 BLAKE2B 4e9d5b91e517d0cb6c5b995142286b8bef31577a1618e06a9084693ac877745b6625b77a07950e11f3d8e8948bb326e1aeb7daa732b7acb11c3a7ce804de1bcd SHA512 220e3ba44a57d145eba8b648a59ac6bdaeea9ea2dd43addec95a8a2934c44c92442494e4ccc179a7bc80019bd312f0b429978eaee4dbba334e16c3af96649229 +DIST genpatches-6.18-5.base.tar.xz 333884 BLAKE2B a7b06489d4362d08ae0f8d35eac17713924522b476db65186ec80adc66ce0b68aa68a092b5f630e0548934e493f26a17760d5d9a13ab203932c3db1f0f00c4c7 SHA512 d402223d594e087ccd639bc1506b932b2cf9c2a16f9d50eaf8308372af2e3a2525af1a12e51b37b5148b6b98df3c6b8305cc946dacefbd61d240f866234f9c78 +DIST genpatches-6.18-5.extras.tar.xz 4324 BLAKE2B 885772df3f69a71daac0d08ca4083e37a436818cc7607bbef11011959ba42db6842a42af28f120273dd3706fa219f6aa3873cc07449da004a4d2368e1ba3960a SHA512 0ebd28094d49c5b6c04cb0f8ca67d321bf1df8bf2977751daa7a8eaa1f8a50d4a140226533ea411776b0c3652ff583764f20dbd8d800a9bb363df4b3d183eecc DIST linux-6.18.tar.xz 154309096 BLAKE2B b94b7b9bf18aca0c3e50baf79b009a1448fc6cd9c3ee019f641cc247dcf53a4abef4274ee0608ad8cd4943af69854363a95d26e117ff23620bb07dccb158859f SHA512 88599ffdec96d150c1feb9b261ba93bb0301a9d0e1ad6bef7aeab1f5372cbfc57d8b43c7e902bd8f76921d1dbd8189663c142ea869e51d0e2b483b150ee00fe0 DIST linux-v6.18.2-zen2.patch.zst 151600 BLAKE2B d390c7b9722b0fe5e10e56f7f00607d80e9a63329b1b0711e998529e5cb3bfa930c042331100fe1d847e3d1a23b3ab417e85011bb92d9913bc6a0308bc3a3b7b SHA512 93920e4f37919066937033ffa3cce9267060d14342c490016c68fe8ede0296ab5d9783f6ab8a956bb8ecbd49bc3c3ea7515187c882c8fe58ced696da1e52999e +DIST linux-v6.18.3-zen1.patch.zst 154027 BLAKE2B cd7c7026515feddc80accdb663da531f10f3c10ac92849ff0039b62d37bd9f826c6dd68841eead353564d4eb592f13f0460b6f6144e3cb42815b7efa5c7b7f51 SHA512 f3663625f35ee55a191384cede415790aa6f484b925f3cee4b40a8598577af68c22748b43d052fc591ecff160985ba36f3ab088c684f1c93f3fbef24981880b0 diff --git a/sys-kernel/zen-sources/files/0001-sched-proxy-Yield-the-donor-task.patch b/sys-kernel/zen-sources/files/0001-sched-proxy-Yield-the-donor-task.patch new file mode 100644 index 000000000000..b3437399ea49 --- /dev/null +++ b/sys-kernel/zen-sources/files/0001-sched-proxy-Yield-the-donor-task.patch @@ -0,0 +1,119 @@ +From d4ed8eac96348fdf65c285a1b756808581a80a69 Mon Sep 17 00:00:00 2001 +From: Fernand Sieber <[email protected]> +Date: Thu, 6 Nov 2025 12:40:10 +0200 +Subject: [PATCH] sched/proxy: Yield the donor task + +When executing a task in proxy context, handle yields as if they were +requested by the donor task. This matches the traditional PI semantics +of yield() as well. + +This avoids scenario like proxy task yielding, pick next task selecting the +same previous blocked donor, running the proxy task again, etc. + +Reported-by: kernel test robot <[email protected]> +Closes: https://lore.kernel.org/oe-lkp/[email protected] +Suggested-by: Peter Zijlstra <[email protected]> +Signed-off-by: Fernand Sieber <[email protected]> +Signed-off-by: Peter Zijlstra (Intel) <[email protected]> +Link: https://patch.msgid.link/[email protected] +Signed-off-by: Brahmajit Das <[email protected]> +--- + kernel/sched/deadline.c | 2 +- + kernel/sched/ext.c | 4 ++-- + kernel/sched/fair.c | 2 +- + kernel/sched/rt.c | 2 +- + kernel/sched/syscalls.c | 5 +++-- + 5 files changed, 8 insertions(+), 7 deletions(-) + +diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c +index 19b1a8b81c76..d3be71d5a9cc 100644 +--- a/kernel/sched/deadline.c ++++ b/kernel/sched/deadline.c +@@ -2143,7 +2143,7 @@ static void yield_task_dl(struct rq *rq) + * it and the bandwidth timer will wake it up and will give it + * new scheduling parameters (thanks to dl_yielded=1). + */ +- rq->curr->dl.dl_yielded = 1; ++ rq->donor->dl.dl_yielded = 1; + + update_rq_clock(rq); + update_curr_dl(rq); +diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c +index b959a70471c1..907eea83294c 100644 +--- a/kernel/sched/ext.c ++++ b/kernel/sched/ext.c +@@ -1493,7 +1493,7 @@ static bool dequeue_task_scx(struct rq *rq, struct task_struct *p, int deq_flags + static void yield_task_scx(struct rq *rq) + { + struct scx_sched *sch = scx_root; +- struct task_struct *p = rq->curr; ++ struct task_struct *p = rq->donor; + + if (SCX_HAS_OP(sch, yield)) + SCX_CALL_OP_2TASKS_RET(sch, SCX_KF_REST, yield, rq, p, NULL); +@@ -1504,7 +1504,7 @@ static void yield_task_scx(struct rq *rq) + static bool yield_to_task_scx(struct rq *rq, struct task_struct *to) + { + struct scx_sched *sch = scx_root; +- struct task_struct *from = rq->curr; ++ struct task_struct *from = rq->donor; + + if (SCX_HAS_OP(sch, yield)) + return SCX_CALL_OP_2TASKS_RET(sch, SCX_KF_REST, yield, rq, +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index d30dfd6f18b7..99a10815ca17 100644 +--- a/kernel/sched/fair.c ++++ b/kernel/sched/fair.c +@@ -9006,7 +9006,7 @@ static void put_prev_task_fair(struct rq *rq, struct task_struct *prev, struct t + */ + static void yield_task_fair(struct rq *rq) + { +- struct task_struct *curr = rq->curr; ++ struct task_struct *curr = rq->donor; + struct cfs_rq *cfs_rq = task_cfs_rq(curr); + struct sched_entity *se = &curr->se; + +diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c +index 7936d4333731..fb07dcfc60a2 100644 +--- a/kernel/sched/rt.c ++++ b/kernel/sched/rt.c +@@ -1490,7 +1490,7 @@ static void requeue_task_rt(struct rq *rq, struct task_struct *p, int head) + + static void yield_task_rt(struct rq *rq) + { +- requeue_task_rt(rq, rq->curr, 0); ++ requeue_task_rt(rq, rq->donor, 0); + } + + static int find_lowest_rq(struct task_struct *task); +diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c +index a2b06eba44e7..417eb6a63015 100644 +--- a/kernel/sched/syscalls.c ++++ b/kernel/sched/syscalls.c +@@ -1607,7 +1607,7 @@ static void do_sched_yield(void) + rq = this_rq_lock_irq(&rf); + + schedstat_inc(rq->yld_count); +- current->sched_class->yield_task(rq); ++ rq->donor->sched_class->yield_task(rq); + #endif /* !CONFIG_SCHED_ALT */ + + preempt_disable(); +@@ -1680,12 +1680,13 @@ int __sched yield_to(struct task_struct *p, bool preempt) + #ifdef CONFIG_SCHED_ALT + return 0; + #else /* !CONFIG_SCHED_ALT */ +- struct task_struct *curr = current; ++ struct task_struct *curr; + struct rq *rq, *p_rq; + int yielded = 0; + + scoped_guard (raw_spinlock_irqsave, &p->pi_lock) { + rq = this_rq(); ++ curr = rq->donor; + + again: + p_rq = task_rq(p); +-- +2.52.0 + diff --git a/sys-kernel/zen-sources/zen-sources-6.18.3.ebuild b/sys-kernel/zen-sources/zen-sources-6.18.3.ebuild new file mode 100644 index 000000000000..ee11fdc4a930 --- /dev/null +++ b/sys-kernel/zen-sources/zen-sources-6.18.3.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" +ETYPE="sources" +K_WANT_GENPATCHES="base extras" +K_GENPATCHES_VER="5" +K_SECURITY_UNSUPPORTED="1" +K_NOSETEXTRAVERSION="1" +K_NODRYRUN="yes" + +inherit kernel-2 unpacker +detect_version +detect_arch + +DESCRIPTION="The Zen Kernel Live Sources" +HOMEPAGE="https://github.com/zen-kernel" + +# Needed for zstd compression of the patch +BDEPEND="$(unpacker_src_uri_depends)" + +ZEN_VER=1 +ZEN_URI="https://github.com/zen-kernel/zen-kernel/releases/download/v${PV}-zen${ZEN_VER}/linux-v${PV}-zen${ZEN_VER}.patch.zst" +SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${ZEN_URI}" + +KEYWORDS="~amd64 ~arm64 ~x86" + +PATCHES=( + "${FILESDIR}/0001-sched-proxy-Yield-the-donor-task.patch" +) + +UNIPATCH_LIST="${WORKDIR}/linux-v${PV}-zen${ZEN_VER}.patch" +UNIPATCH_STRICTORDER="yes" +UNIPATCH_EXCLUDE="1810 2701" + +K_EXTRAEINFO="For more info on zen-sources, and for how to report problems, see: \ +${HOMEPAGE}, also go to #zen-sources on oftc" + +src_unpack() { + unpacker "linux-v${PV}-zen${ZEN_VER}.patch.zst" + kernel-2_src_unpack +} + +pkg_setup() { + ewarn + ewarn "${PN} is *not* supported by the Gentoo Kernel Project in any way." + ewarn "If you need support, please contact the zen developers directly." + ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with" + ewarn "the ebuilds. Thank you." + ewarn + kernel-2_pkg_setup +} + +src_prepare() { + default + kernel-2_src_prepare +} + +src_install() { + rm "${WORKDIR}/linux-v${PV}-zen${ZEN_VER}.patch" || die + kernel-2_src_install +} + +pkg_postrm() { + kernel-2_pkg_postrm +}
