summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorblacksky32023-06-29 00:24:56 -0400
committerblacksky32023-06-29 00:24:56 -0400
commit8e08723773c98912f929025266b9682c7cab409f (patch)
tree164e49d90714298aee873cfa4f1df3bfb1e81685
parent61efd131a371f936ca9dc2781078c3b44df78d28 (diff)
downloadaur-8e08723773c98912f929025266b9682c7cab409f.tar.gz
update
-rw-r--r--.SRCINFO81
-rw-r--r--0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch154
-rw-r--r--0001-linux6.1.y-bore2.4.0.patch421
-rw-r--r--0002-constgran-vanilla-max.patch86
-rw-r--r--PKGBUILD188
5 files changed, 235 insertions, 695 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 200cde45e516..69be33c909b0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,20 +1,21 @@
pkgbase = linux-bore
pkgdesc = The Linux kernel and modules with Masahito Suzuki BORE CPU scheduler and Arch patches
- pkgver = 6.3.8
+ pkgver = 6.4.0
pkgrel = 1
url = https://www.kernel.org/
arch = x86_64
license = GPL2
makedepends = bc
- makedepends = kmod
+ makedepends = cpio
+ makedepends = gettext
+ makedepends = git
makedepends = libelf
makedepends = pahole
- makedepends = cpio
makedepends = perl
makedepends = tar
makedepends = xz
+ makedepends = kmod
makedepends = xmlto
- makedepends = git
makedepends = bison
makedepends = flex
makedepends = zstd
@@ -25,16 +26,68 @@ pkgbase = linux-bore
makedepends = glibc
makedepends = binutils
options = !strip
- source = https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.3.8.tar.xz
- source = https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/raw/e7308a977d83f3cf94ed228b0f6b9b65a4d9139c/config
- source = 0001-linux6.1.y-bore2.4.0.patch
- source = 0002-constgran-vanilla-max.patch
- source = 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
- sha256sums = 4323d421250e2e444c35d36f4aa8ddb56591dedc25c68d359d19c4ef9dd20955
- sha256sums = 6508516de94ed941ae755d89807610dc51fe1229dbfecdf8a82604a8d33242ce
- sha256sums = e788c1d25df2ffa710c3be4786dd477a82e8271d2950ddca89b56957035b4a5f
- sha256sums = 466d7231d2bba65edb53da48e0ec444499e4ba526e9067b517fb78bf09973486
- sha256sums = d4edb692d0a1772af639730d898282e92a3c06acc46e5a55429315b2a5763e82
+ source = https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.4.tar.xz
+ source = https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/raw/1b45fa8cd58990bf455b429c598b6d4bad155172/config
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/bore/bore/0001-linux6.4-bore2.4.1.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/arch/v6.4-arch1/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/0001-bfq-cachyos-patches-v1.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/0001-block-set-rq_affinity-to-force-full-multithreading-I-v1.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/0001-btrfs-6.4-merge-changes-from-dev-tree-v1.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/0001-drm-6.4-Add-HDR-patches-v1.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/0001-hid-6.4-merge-changes-from-dev-tree-v1.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/0001-x86-Avoid-relocation-information-in-final-vmlinux-v1.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/0001-zstd-6.4-import-v1.5.5-v1.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/0001-zstd-modules-cachyos-patches-v1.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/tkg/0001-mm-Support-soft-dirty-flag-reset-for-VA-range.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/tkg/0002-mm-Support-soft-dirty-flag-read-with-reset.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/tkg/0013-optimize_harder_O3.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0001-PCI-Enable-overrides-for-missing-ACS-capabilities.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0001-futex-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-opcode.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0001-winesync-Introduce-the-winesync-driver-and-character.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0001-x86-kconfig-more-uarches-for-kernel-5.17-xm_rev2.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0001-XANMOD-x86-build-Add-more-x86_64-optimizations.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0002-XANMOD-Makefile-Move-ARM-and-x86-instruction-set-sel.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0011-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0012-XANMOD-mm-vmscan-vm_swappiness-30-decreases-the-amou.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0016-XANMOD-Makefile-Disable-GCC-vectorization-on-trees.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0003-x86-vdso-Use-lfence-instead-of-rep-and-nop.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0004-sched-wait-Do-accept-in-LIFO-order-for-cache-efficie.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0005-intel_rapl-Silence-rapl-trace-debug.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0006-firmware-Enable-stateless-firmware-loading.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0007-locking-rwsem-spin-faster.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0008-drivers-initialize-ata-before-graphics.patch
+ source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0009-init-wait-for-partition-and-retry-scan.patch
+ sha256sums = 8fa0588f0c2ceca44cac77a0e39ba48c9f00a6b9dc69761c02a5d3efac8da7f3
+ sha256sums = ab8e459ac900f4f2b2677d9692177afdfb215e75b8315259ef8bdd0a1ea032e1
+ sha256sums = 1d4d837c52015895a6dfa982116396ef198f92b7a85b096e9579f5c3fb1bb2fb
+ sha256sums = db411b01a5896283fdaf1cf30733d41e9740320a3f422b23ee8b376b8a5e8930
+ sha256sums = 12de7fe29e482e6f0edfd48123c468a309b69d3cca1be4a773c1b96ef6697d22
+ sha256sums = 5d0faf58c6c9e58d709ec2e136bdd576ebd4c0f7d630bef5a05bf188dd482579
+ sha256sums = 2cab3863f3e21a8f8e83b3f86743c57c3f37bf086cc01ebf4573c218df229655
+ sha256sums = 5b9a5d0c5c81960d981d01febe201689794b58bb835b2cadadfbdda42b74f47f
+ sha256sums = 0867b5cb21a0765fd7b76d3724fc8a258bedbba974b6e4dbd62348f6ce7d9cee
+ sha256sums = 81cc1547d62933e04aed15c57b9e93101e546298b1fef5f63a6b1469471acebe
+ sha256sums = dd20963020f83e30497ebeccdeace10e98b74ebffa5847de334eeaaae80f5046
+ sha256sums = de7a2748545b2b5d0082c09373c14d9ee41110dfa5e30a3be02e3500c2a8118c
+ sha256sums = 7c913c3b58001d3534b1f1828e920ca61707b545c228714420237af51f2ec77b
+ sha256sums = 1fbf26545a49ce297434fa2c39217361cdd90285b2c5ff04c505008037ede6c5
+ sha256sums = 85669071475af9e4ca74cb15c1f277dadd5ea7b3050f443712da77230a4aa488
+ sha256sums = b4b4f1c20891d1b104354dd574dda80d2f3c5e4f49c76f361c058ffb5b973fd4
+ sha256sums = 4fd244250dad9949dffad6a42b702384c1b1197297f87ffe80cb45496c29cb25
+ sha256sums = f440d27364ad757ea3cf36454a590f0329f8a6e29f630aa497705840f72e214a
+ sha256sums = 75b4f9c09aeaa34f14677ccf8dffe30d786b12235eaf4a0cd9654eaa14e63bbb
+ sha256sums = 5756ce78a788e58f6986640f4699bdb0672742e264b8702997ef5e7feadfc6db
+ sha256sums = f3008b53ec36dba2d71640d8605f6cbf4c5951beadb62f1b614eeefd74d7bdb2
+ sha256sums = 71e4fae21123107f00b5e08f0345591f41c61aa918d3e3680c025ce3a78a8a64
+ sha256sums = 9a1eb034d4a142be9686835d47ebe1998d8f618436756c89b4521fa1a7f13e0f
+ sha256sums = ab6409a7a582ef65bd44519bc56b06eb796c450468a88c7d4fdd67f972488b1b
+ sha256sums = 1e8d4ddba087aeac79c54acee0f37b4ee5d2c7f43f064b2c8cf29d668f798e3f
+ sha256sums = 6579c78554b1f1e97a6a439b4287cd542747208774af4070b6d116456e575429
+ sha256sums = 0ad556c65afca9688ea495106c632d7e479e60e4e2241007a7ef4120f65b27a0
+ sha256sums = 217791179fcf7d522ed8065b4cf49fb9097522b936a8852901dde0702ea90954
+ sha256sums = 9a0fd7b40032514b83ec200cd7aeffccf835889c4b86c012e1b9f50fffbfd1a2
+ sha256sums = 8b7be40de00645ca42ee5c7079bf7d7531de75ecdff97a30914d5d604d7efb58
+ sha256sums = 7352643e67f651d322b2443e25f7b6ab30a667e3dde6fc2688cb75c24ef0ae84
pkgname = linux-bore
diff --git a/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch b/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
deleted file mode 100644
index b48186b1a10b..000000000000
--- a/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
+++ /dev/null
@@ -1,154 +0,0 @@
-From d73ae82da61377a3f89ec5eded369fd186cbd165 Mon Sep 17 00:00:00 2001
-From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
-Date: Mon, 16 Sep 2019 04:53:20 +0200
-Subject: [PATCH] ZEN: Add sysctl and CONFIG to disallow unprivileged
- CLONE_NEWUSER
-
-Our default behavior continues to match the vanilla kernel.
----
- include/linux/user_namespace.h | 4 ++++
- init/Kconfig | 16 ++++++++++++++++
- kernel/fork.c | 14 ++++++++++++++
- kernel/sysctl.c | 12 ++++++++++++
- kernel/user_namespace.c | 7 +++++++
- 5 files changed, 53 insertions(+)
-
-diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
-index 45f09bec0..87b20e2ee 100644
---- a/include/linux/user_namespace.h
-+++ b/include/linux/user_namespace.h
-@@ -148,6 +148,8 @@ static inline void set_userns_rlimit_max(struct user_namespace *ns,
-
- #ifdef CONFIG_USER_NS
-
-+extern int unprivileged_userns_clone;
-+
- static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
- {
- if (ns)
-@@ -181,6 +183,8 @@ extern bool current_in_userns(const struct user_namespace *target_ns);
- struct ns_common *ns_get_owner(struct ns_common *ns);
- #else
-
-+#define unprivileged_userns_clone 0
-+
- static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
- {
- return &init_user_ns;
-diff --git a/init/Kconfig b/init/Kconfig
-index c88bb30a8..32ba96d94 100644
---- a/init/Kconfig
-+++ b/init/Kconfig
-@@ -1249,6 +1249,22 @@ config USER_NS
-
- If unsure, say N.
-
-+config USER_NS_UNPRIVILEGED
-+ bool "Allow unprivileged users to create namespaces"
-+ default y
-+ depends on USER_NS
-+ help
-+ When disabled, unprivileged users will not be able to create
-+ new namespaces. Allowing users to create their own namespaces
-+ has been part of several recent local privilege escalation
-+ exploits, so if you need user namespaces but are
-+ paranoid^Wsecurity-conscious you want to disable this.
-+
-+ This setting can be overridden at runtime via the
-+ kernel.unprivileged_userns_clone sysctl.
-+
-+ If unsure, say Y.
-+
- config PID_NS
- bool "PID Namespaces"
- default y
-diff --git a/kernel/fork.c b/kernel/fork.c
-index 1ec1e9ea4..90e639a39 100644
---- a/kernel/fork.c
-+++ b/kernel/fork.c
-@@ -98,6 +98,10 @@
- #include <linux/bpf.h>
- #include <linux/stackprotector.h>
-
-+#ifdef CONFIG_USER_NS
-+#include <linux/user_namespace.h>
-+#endif
-+
- #include <asm/pgalloc.h>
- #include <linux/uaccess.h>
- #include <asm/mmu_context.h>
-@@ -2032,6 +2036,10 @@ static __latent_entropy struct task_struct *copy_process(
- if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS))
- return ERR_PTR(-EINVAL);
-
-+ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone)
-+ if (!capable(CAP_SYS_ADMIN))
-+ return ERR_PTR(-EPERM);
-+
- /*
- * Thread groups must share signals as well, and detached threads
- * can only be started up within the thread group.
-@@ -3182,6 +3190,12 @@ int ksys_unshare(unsigned long unshare_flags)
- if (unshare_flags & CLONE_NEWNS)
- unshare_flags |= CLONE_FS;
-
-+ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) {
-+ err = -EPERM;
-+ if (!capable(CAP_SYS_ADMIN))
-+ goto bad_unshare_out;
-+ }
-+
- err = check_unshare_flags(unshare_flags);
- if (err)
- goto bad_unshare_out;
-diff --git a/kernel/sysctl.c b/kernel/sysctl.c
-index 1c240d2c9..2971581a2 100644
---- a/kernel/sysctl.c
-+++ b/kernel/sysctl.c
-@@ -81,6 +81,9 @@
- #ifdef CONFIG_RT_MUTEXES
- #include <linux/rtmutex.h>
- #endif
-+#ifdef CONFIG_USER_NS
-+#include <linux/user_namespace.h>
-+#endif
-
- /* shared constants to be used in various sysctls */
- const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 };
-@@ -1645,6 +1648,15 @@ static struct ctl_table kern_table[] = {
- .mode = 0644,
- .proc_handler = proc_dointvec,
- },
-+#ifdef CONFIG_USER_NS
-+ {
-+ .procname = "unprivileged_userns_clone",
-+ .data = &unprivileged_userns_clone,
-+ .maxlen = sizeof(int),
-+ .mode = 0644,
-+ .proc_handler = proc_dointvec,
-+ },
-+#endif
- #ifdef CONFIG_PROC_SYSCTL
- {
- .procname = "tainted",
-diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
-index 1d8e47bed..fec01d016 100644
---- a/kernel/user_namespace.c
-+++ b/kernel/user_namespace.c
-@@ -22,6 +22,13 @@
- #include <linux/bsearch.h>
- #include <linux/sort.h>
-
-+/* sysctl */
-+#ifdef CONFIG_USER_NS_UNPRIVILEGED
-+int unprivileged_userns_clone = 1;
-+#else
-+int unprivileged_userns_clone;
-+#endif
-+
- static struct kmem_cache *user_ns_cachep __read_mostly;
- static DEFINE_MUTEX(userns_state_mutex);
-
---
-2.41.0
-
diff --git a/0001-linux6.1.y-bore2.4.0.patch b/0001-linux6.1.y-bore2.4.0.patch
deleted file mode 100644
index 12e8f7290d27..000000000000
--- a/0001-linux6.1.y-bore2.4.0.patch
+++ /dev/null
@@ -1,421 +0,0 @@
-From e27a03de3de1923af334499d1160715d8facc013 Mon Sep 17 00:00:00 2001
-From: Masahito S <firelzrd@gmail.com>
-Date: Thu, 8 Jun 2023 07:50:42 +0900
-Subject: [PATCH] linux6.1.y-bore2.4.0
-
----
- include/linux/sched.h | 10 +++
- init/Kconfig | 20 ++++++
- kernel/sched/core.c | 62 ++++++++++++++++++
- kernel/sched/debug.c | 3 +
- kernel/sched/fair.c | 136 ++++++++++++++++++++++++++++++++++++++++
- kernel/sched/features.h | 8 +++
- 6 files changed, 239 insertions(+)
-
-diff --git a/include/linux/sched.h b/include/linux/sched.h
-index ffb6eb55c..160343f67 100644
---- a/include/linux/sched.h
-+++ b/include/linux/sched.h
-@@ -555,6 +555,12 @@ struct sched_entity {
- u64 sum_exec_runtime;
- u64 vruntime;
- u64 prev_sum_exec_runtime;
-+#ifdef CONFIG_SCHED_BORE
-+ u64 prev_burst_time;
-+ u64 burst_time;
-+ u64 max_burst_time;
-+ u8 penalty_score;
-+#endif // CONFIG_SCHED_BORE
-
- u64 nr_migrations;
-
-@@ -989,6 +995,10 @@ struct task_struct {
- struct list_head children;
- struct list_head sibling;
- struct task_struct *group_leader;
-+#ifdef CONFIG_SCHED_BORE
-+ u64 child_burst_cache;
-+ u64 child_burst_last_cached;
-+#endif // CONFIG_SCHED_BORE
-
- /*
- * 'ptraced' is the list of tasks this task is using ptrace() on.
-diff --git a/init/Kconfig b/init/Kconfig
-index 0c214af99..43f67c63e 100644
---- a/init/Kconfig
-+++ b/init/Kconfig
-@@ -1283,6 +1283,26 @@ config CHECKPOINT_RESTORE
-
- If unsure, say N here.
-
-+config SCHED_BORE
-+ bool "Burst-Oriented Response Enhancer"
-+ default y
-+ help
-+ In Desktop and Mobile computing, one might prefer interactive
-+ tasks to keep responsive no matter what they run in the background.
-+
-+ Enabling this kernel feature modifies the scheduler to discriminate
-+ tasks by their burst time (runtime since it last went sleeping or
-+ yielding state) and prioritize those that run less bursty.
-+ Such tasks usually include window compositor, widgets backend,
-+ terminal emulator, video playback, games and so on.
-+ With a little impact to scheduling fairness, it may improve
-+ responsiveness especially under heavy background workload.
-+
-+ You can turn it off by setting the sysctl kernel.sched_bore = 0.
-+ Enabling this feature implies NO_GENTLE_FAIR_SLEEPERS by default.
-+
-+ If unsure say Y here.
-+
- config SCHED_AUTOGROUP
- bool "Automatic process group scheduling"
- select CGROUPS
-diff --git a/kernel/sched/core.c b/kernel/sched/core.c
-index 9ebfd4841..8d050203f 100644
---- a/kernel/sched/core.c
-+++ b/kernel/sched/core.c
-@@ -4364,6 +4364,57 @@ int wake_up_state(struct task_struct *p, unsigned int state)
- return try_to_wake_up(p, state, 0);
- }
-
-+#ifdef CONFIG_SCHED_BORE
-+#define CHILD_BURST_CUTOFF_BITS 9
-+extern unsigned int sched_burst_cache_lifetime;
-+
-+void __init sched_init_bore(void) {
-+ init_task.child_burst_cache = 0;
-+ init_task.child_burst_last_cached = 0;
-+ init_task.se.prev_burst_time = 0;
-+ init_task.se.burst_time = 0;
-+ init_task.se.max_burst_time = 0;
-+}
-+
-+void inline __sched_fork_bore(struct task_struct *p) {
-+ p->child_burst_cache = 0;
-+ p->child_burst_last_cached = 0;
-+ p->se.burst_time = 0;
-+}
-+
-+static inline void update_task_child_burst_time_cache(struct task_struct *p) {
-+ u64 sum = 0, avg_burst_time = 0;
-+ u32 cnt = 0;
-+ struct task_struct *child;
-+
-+ read_lock(&tasklist_lock);
-+ list_for_each_entry(child, &p->children, sibling) {
-+ cnt++;
-+ sum += child->se.max_burst_time >> CHILD_BURST_CUTOFF_BITS;
-+ }
-+ read_unlock(&tasklist_lock);
-+
-+ if (cnt) avg_burst_time = div_u64(sum, cnt) << CHILD_BURST_CUTOFF_BITS;
-+ p->child_burst_cache = max(avg_burst_time, p->se.max_burst_time);
-+}
-+
-+static void update_task_initial_burst_time(struct task_struct *task) {
-+ struct sched_entity *se = &task->se;
-+ struct task_struct *par = task->real_parent;
-+ u64 ktime = ktime_to_ns(ktime_get());
-+
-+ if (likely(par)) {
-+ if (par->child_burst_last_cached + sched_burst_cache_lifetime < ktime) {
-+ par->child_burst_last_cached = ktime;
-+ update_task_child_burst_time_cache(par);
-+ }
-+ se->prev_burst_time = max(se->prev_burst_time, par->child_burst_cache);
-+ }
-+
-+ se->max_burst_time = se->prev_burst_time;
-+}
-+#endif // CONFIG_SCHED_BORE
-+
- /*
- * Perform scheduler related setup for a newly forked process p.
- * p is forked by current.
-@@ -4380,6 +4431,9 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
- p->se.prev_sum_exec_runtime = 0;
- p->se.nr_migrations = 0;
- p->se.vruntime = 0;
-+#ifdef CONFIG_SCHED_BORE
-+ __sched_fork_bore(p);
-+#endif // CONFIG_SCHED_BORE
- INIT_LIST_HEAD(&p->se.group_node);
-
- #ifdef CONFIG_FAIR_GROUP_SCHED
-@@ -4594,6 +4648,9 @@ late_initcall(sched_core_sysctl_init);
- int sched_fork(unsigned long clone_flags, struct task_struct *p)
- {
- __sched_fork(clone_flags, p);
-+#ifdef CONFIG_SCHED_BORE
-+ update_task_initial_burst_time(p);
-+#endif // CONFIG_SCHED_BORE
- /*
- * We mark the process as NEW here. This guarantees that
- * nobody will actually run it, and a signal or other external
-@@ -9674,6 +9731,11 @@ void __init sched_init(void)
- BUG_ON(&dl_sched_class != &stop_sched_class + 1);
- #endif
-
-+#ifdef CONFIG_SCHED_BORE
-+ sched_init_bore();
-+ printk(KERN_INFO "BORE (Burst-Oriented Response Enhancer) CPU Scheduler modification 2.4.0 by Masahito Suzuki");
-+#endif // CONFIG_SCHED_BORE
-+
- wait_bit_init();
-
- #ifdef CONFIG_FAIR_GROUP_SCHED
-diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
-index 1637b65ba..752c43a9f 100644
---- a/kernel/sched/debug.c
-+++ b/kernel/sched/debug.c
-@@ -547,6 +547,9 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
- SPLIT_NS(schedstat_val_or_zero(p->stats.sum_sleep_runtime)),
- SPLIT_NS(schedstat_val_or_zero(p->stats.sum_block_runtime)));
-
-+#ifdef CONFIG_SCHED_BORE
-+ SEQ_printf(m, " %2d", p->se.penalty_score);
-+#endif
- #ifdef CONFIG_NUMA_BALANCING
- SEQ_printf(m, " %d %d", task_node(p), task_numa_group_id(p));
- #endif
-diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
-index 88821ab00..b7a116888 100644
---- a/kernel/sched/fair.c
-+++ b/kernel/sched/fair.c
-@@ -19,6 +19,9 @@
- *
- * Adaptive scheduling granularity, math enhancements by Peter Zijlstra
- * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra
-+ *
-+ * Burst-Oriented Response Enhancer (BORE) CPU Scheduler
-+ * Copyright (C) 2021-2023 Masahito Suzuki <firelzrd@gmail.com>
- */
- #include <linux/energy_model.h>
- #include <linux/mmap_lock.h>
-@@ -126,6 +129,61 @@ static unsigned int normalized_sysctl_sched_wakeup_granularity = 1000000UL;
-
- const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
-
-+#ifdef CONFIG_SCHED_BORE
-+unsigned int __read_mostly sched_bore = 1;
-+unsigned int __read_mostly sched_burst_cache_lifetime = 15000000;
-+unsigned int __read_mostly sched_burst_penalty_offset = 12;
-+unsigned int __read_mostly sched_burst_penalty_scale = 1292;
-+unsigned int __read_mostly sched_burst_smoothness = 1;
-+static int three = 3;
-+static int sixty_four = 64;
-+static int maxval_12_bits = 4095;
-+
-+#define FIXED_SHIFT 10
-+#define FIXED_ONE (1 << FIXED_SHIFT)
-+typedef u32 fixed;
-+
-+static void update_burst_score(struct sched_entity *se) {
-+ u64 burst_time = se->max_burst_time;
-+
-+ int msb = fls64(burst_time);
-+ fixed integer_part = msb << FIXED_SHIFT;
-+ fixed fractional_part = burst_time << (64 - msb) << 1 >> (64 - FIXED_SHIFT);
-+ fixed greed = integer_part | fractional_part;
-+
-+ fixed tolerance = sched_burst_penalty_offset << FIXED_SHIFT;
-+ fixed penalty = max(0, (s32)greed - (s32)tolerance);
-+ fixed scaled_penalty = penalty * sched_burst_penalty_scale >> 10;
-+
-+ u8 score = min(39U, scaled_penalty >> FIXED_SHIFT);
-+ se->penalty_score = score;
-+}
-+
-+static inline u64 penalty_scale(u64 delta, struct sched_entity *se) {
-+ return mul_u64_u32_shr(delta, sched_prio_to_wmult[se->penalty_score], 22);
-+}
-+
-+static inline u64 __binary_smooth(u64 new, u64 old, unsigned int smoothness) {
-+ return (new + old * ((1 << smoothness) - 1)) >> smoothness;
-+}
-+
-+void restart_burst(struct sched_entity *se) {
-+ se->max_burst_time = se->prev_burst_time = __binary_smooth(
-+ se->burst_time, se->prev_burst_time, sched_burst_smoothness);
-+ se->burst_time = 0;
-+}
-+
-+#define calc_delta_fair(delta, se) __calc_delta_fair(delta, se, true)
-+#define calc_delta_fair_unscaled(delta, se) __calc_delta_fair(delta, se, false)
-+static inline u64
-+__calc_delta_fair(u64 delta, struct sched_entity *se, bool bscale);
-+
-+static s64 wakeup_preempt_backstep_delta(u64 rtime, struct sched_entity *se) {
-+ u64 delta = calc_delta_fair_unscaled(rtime, se);
-+ return delta - penalty_scale(delta, se);
-+}
-+#endif // CONFIG_SCHED_BORE
-+
- int sched_thermal_decay_shift;
- static int __init setup_sched_thermal_decay_shift(char *str)
- {
-@@ -180,6 +238,51 @@ static unsigned int sysctl_sched_cfs_bandwidth_slice = 5000UL;
-
- #ifdef CONFIG_SYSCTL
- static struct ctl_table sched_fair_sysctls[] = {
-+#ifdef CONFIG_SCHED_BORE
-+ {
-+ .procname = "sched_bore",
-+ .data = &sched_bore,
-+ .maxlen = sizeof(unsigned int),
-+ .mode = 0644,
-+ .proc_handler = &proc_dointvec_minmax,
-+ .extra1 = SYSCTL_ZERO,
-+ .extra2 = SYSCTL_ONE,
-+ },
-+ {
-+ .procname = "sched_burst_cache_lifetime",
-+ .data = &sched_burst_cache_lifetime,
-+ .maxlen = sizeof(unsigned int),
-+ .mode = 0644,
-+ .proc_handler = proc_dointvec,
-+ },
-+ {
-+ .procname = "sched_burst_penalty_offset",
-+ .data = &sched_burst_penalty_offset,
-+ .maxlen = sizeof(unsigned int),
-+ .mode = 0644,
-+ .proc_handler = &proc_dointvec_minmax,
-+ .extra1 = SYSCTL_ZERO,
-+ .extra2 = &sixty_four,
-+ },
-+ {
-+ .procname = "sched_burst_penalty_scale",
-+ .data = &sched_burst_penalty_scale,
-+ .maxlen = sizeof(unsigned int),
-+ .mode = 0644,
-+ .proc_handler = &proc_dointvec_minmax,
-+ .extra1 = SYSCTL_ZERO,
-+ .extra2 = &maxval_12_bits,
-+ },
-+ {
-+ .procname = "sched_burst_smoothness",
-+ .data = &sched_burst_smoothness,
-+ .maxlen = sizeof(unsigned int),
-+ .mode = 0644,
-+ .proc_handler = &proc_dointvec_minmax,
-+ .extra1 = SYSCTL_ZERO,
-+ .extra2 = &three,
-+ },
-+#endif // CONFIG_SCHED_BORE
- {
- .procname = "sched_child_runs_first",
- .data = &sysctl_sched_child_runs_first,
-@@ -691,11 +794,19 @@ int sched_update_scaling(void)
- /*
- * delta /= w
- */
-+#ifdef CONFIG_SCHED_BORE
-+static inline u64
-+__calc_delta_fair(u64 delta, struct sched_entity *se, bool bscale)
-+#else // CONFIG_SCHED_BORE
- static inline u64 calc_delta_fair(u64 delta, struct sched_entity *se)
-+#endif // CONFIG_SCHED_BORE
- {
- if (unlikely(se->load.weight != NICE_0_LOAD))
- delta = __calc_delta(delta, NICE_0_LOAD, &se->load);
-
-+#ifdef CONFIG_SCHED_BORE
-+ if (bscale && sched_bore) delta = penalty_scale(delta, se);
-+#endif // CONFIG_SCHED_BORE
- return delta;
- }
-
-@@ -905,6 +1016,14 @@ static void update_curr(struct cfs_rq *cfs_rq)
- curr->sum_exec_runtime += delta_exec;
- schedstat_add(cfs_rq->exec_clock, delta_exec);
-
-+#ifdef CONFIG_SCHED_BORE
-+ curr->burst_time += delta_exec;
-+ curr->max_burst_time = max(curr->max_burst_time, curr->burst_time);
-+ update_burst_score(curr);
-+ if (sched_bore)
-+ curr->vruntime += penalty_scale(calc_delta_fair(delta_exec, curr), curr);
-+ else
-+#endif // CONFIG_SCHED_BORE
- curr->vruntime += calc_delta_fair(delta_exec, curr);
- update_min_vruntime(cfs_rq);
-
-@@ -6188,6 +6307,9 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
- util_est_dequeue(&rq->cfs, p);
-
- for_each_sched_entity(se) {
-+#ifdef CONFIG_SCHED_BORE
-+ if (task_sleep) restart_burst(se);
-+#endif // CONFIG_SCHED_BORE
- cfs_rq = cfs_rq_of(se);
- dequeue_entity(cfs_rq, se, flags);
-
-@@ -7531,7 +7653,11 @@ static unsigned long wakeup_gran(struct sched_entity *se)
- * This is especially important for buddies when the leftmost
- * task is higher priority than the buddy.
- */
-+#ifdef CONFIG_SCHED_BORE
-+ return calc_delta_fair_unscaled(gran, se);
-+#else // CONFIG_SCHED_BORE
- return calc_delta_fair(gran, se);
-+#endif // CONFIG_SCHED_BORE
- }
-
- /*
-@@ -7552,6 +7678,13 @@ static int
- wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se)
- {
- s64 gran, vdiff = curr->vruntime - se->vruntime;
-+#ifdef CONFIG_SCHED_BORE
-+ if (sched_bore) {
-+ u64 rtime = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
-+ vdiff += wakeup_preempt_backstep_delta(rtime, curr)
-+ - wakeup_preempt_backstep_delta(rtime, se);
-+ }
-+#endif // CONFIG_SCHED_BORE
-
- if (vdiff <= 0)
- return -1;
-@@ -7897,6 +8030,9 @@ static void yield_task_fair(struct rq *rq)
- struct task_struct *curr = rq->curr;
- struct cfs_rq *cfs_rq = task_cfs_rq(curr);
- struct sched_entity *se = &curr->se;
-+#ifdef CONFIG_SCHED_BORE
-+ restart_burst(se);
-+#endif // CONFIG_SCHED_BORE
-
- /*
- * Are we the only task in the tree?
-diff --git a/kernel/sched/features.h b/kernel/sched/features.h
-index ee7f23c76..3115bde98 100644
---- a/kernel/sched/features.h
-+++ b/kernel/sched/features.h
-@@ -4,7 +4,11 @@
- * them to run sooner, but does not allow tons of sleepers to
- * rip the spread apart.
- */
-+#ifdef CONFIG_SCHED_BORE
-+SCHED_FEAT(GENTLE_FAIR_SLEEPERS, false)
-+#else // CONFIG_SCHED_BORE
- SCHED_FEAT(GENTLE_FAIR_SLEEPERS, true)
-+#endif // CONFIG_SCHED_BORE
-
- /*
- * Place new tasks ahead so that they do not starve already running
-@@ -17,7 +21,11 @@ SCHED_FEAT(START_DEBIT, true)
- * wakeup-preemption), since its likely going to consume data we
- * touched, increases cache locality.
- */
-+#ifdef CONFIG_SCHED_BORE
-+SCHED_FEAT(NEXT_BUDDY, true)
-+#else // CONFIG_SCHED_BORE
- SCHED_FEAT(NEXT_BUDDY, false)
-+#endif // CONFIG_SCHED_BORE
-
- /*
- * Prefer to schedule the task that ran last (when we did
---
-2.25.1
-
diff --git a/0002-constgran-vanilla-max.patch b/0002-constgran-vanilla-max.patch
deleted file mode 100644
index 2685403496a2..000000000000
--- a/0002-constgran-vanilla-max.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 6758adc6a354f18a32b704e8f8ef1f6021515e51 Mon Sep 17 00:00:00 2001
-From: Masahito S <firelzrd@gmail.com>
-Date: Fri, 28 Apr 2023 01:07:13 +0900
-Subject: [PATCH] constgran v4 sched: Make latency / granularity constant
- tunable_scaling = 1 (logarithmic) -> 0 (constant) latency_ns = variable
- 6-24ms -> constant 12.8ms min_granularity_ns = variable 0.75-3ms -> constant
- 1.6ms wakeup_granularity_ns = variable 1-4ms -> constant 6.4ms
-
----
- kernel/sched/fair.c | 31 +++++++++++++++++++++++++++----
- 1 file changed, 27 insertions(+), 4 deletions(-)
-
-diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
-index f8f1efa5f..87923da0f 100644
---- a/kernel/sched/fair.c
-+++ b/kernel/sched/fair.c
-@@ -70,10 +70,16 @@
- * (to see the precise effective timeslice length of your workload,
- * run vmstat and monitor the context-switches (cs) field)
- *
-- * (default: 6ms * (1 + ilog(ncpus)), units: nanoseconds)
-+ * (BORE default: 24ms constant, units: nanoseconds)
-+ * (CFS default: 6ms * (1 + ilog(ncpus)), units: nanoseconds)
- */
-+#ifdef CONFIG_SCHED_BORE
-+unsigned int sysctl_sched_latency = 24000000ULL;
-+static unsigned int normalized_sysctl_sched_latency = 24000000ULL;
-+#else // CONFIG_SCHED_BORE
- unsigned int sysctl_sched_latency = 6000000ULL;
- static unsigned int normalized_sysctl_sched_latency = 6000000ULL;
-+#endif // CONFIG_SCHED_BORE
-
- /*
- * The initial- and re-scaling of tunables is configurable
-@@ -84,17 +90,28 @@ static unsigned int normalized_sysctl_sched_latency = 6000000ULL;
- * SCHED_TUNABLESCALING_LOG - scaled logarithmical, *1+ilog(ncpus)
- * SCHED_TUNABLESCALING_LINEAR - scaled linear, *ncpus
- *
-- * (default SCHED_TUNABLESCALING_LOG = *(1+ilog(ncpus))
-+ * (BORE default SCHED_TUNABLESCALING_NONE = *1 constant)
-+ * (CFS default SCHED_TUNABLESCALING_LOG = *(1+ilog(ncpus))
- */
-+#ifdef CONFIG_SCHED_BORE
-+unsigned int sysctl_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE;
-+#else // CONFIG_SCHED_BORE
- unsigned int sysctl_sched_tunable_scaling = SCHED_TUNABLESCALING_LOG;
-+#endif // CONFIG_SCHED_BORE
-
- /*
- * Minimal preemption granularity for CPU-bound tasks:
- *
-- * (default: 0.75 msec * (1 + ilog(ncpus)), units: nanoseconds)
-+ * (BORE default: 3 msec constant, units: nanoseconds)
-+ * (CFS default: 0.75 msec * (1 + ilog(ncpus)), units: nanoseconds)
- */
-+#ifdef CONFIG_SCHED_BORE
-+unsigned int sysctl_sched_min_granularity = 3000000ULL;
-+static unsigned int normalized_sysctl_sched_min_granularity = 3000000ULL;
-+#else // CONFIG_SCHED_BORE
- unsigned int sysctl_sched_min_granularity = 750000ULL;
- static unsigned int normalized_sysctl_sched_min_granularity = 750000ULL;
-+#endif // CONFIG_SCHED_BORE
-
- /*
- * Minimal preemption granularity for CPU-bound SCHED_IDLE tasks.
-@@ -122,10 +139,16 @@ unsigned int sysctl_sched_child_runs_first __read_mostly;
- * and reduces their over-scheduling. Synchronous workloads will still
- * have immediate wakeup/sleep latencies.
- *
-- * (default: 1 msec * (1 + ilog(ncpus)), units: nanoseconds)
-+ * (BORE default: 4 msec constant, units: nanoseconds)
-+ * (CFS default: 1 msec * (1 + ilog(ncpus)), units: nanoseconds)
- */
-+#ifdef CONFIG_SCHED_BORE
-+unsigned int sysctl_sched_wakeup_granularity = 4000000UL;
-+static unsigned int normalized_sysctl_sched_wakeup_granularity = 4000000UL;
-+#else // CONFIG_SCHED_BORE
- unsigned int sysctl_sched_wakeup_granularity = 1000000UL;
- static unsigned int normalized_sysctl_sched_wakeup_granularity = 1000000UL;
-+#endif // CONFIG_SCHED_BORE
-
- const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
-
---
-2.25.1
-
diff --git a/PKGBUILD b/PKGBUILD
index 1ccc0dea3317..c80888874f7a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -46,16 +46,17 @@ for _p in "${pkgname[@]}"; do
_package${_p#$pkgbase}
}"
done
-pkgver=6.3.8
-_pkgver=6.3.8
+pkgver=6.4.0
+_pkgver=6.4
pkgrel=1
-major=6.3
-commit=e7308a977d83f3cf94ed228b0f6b9b65a4d9139c
+major=6.4
+commit=1b45fa8cd58990bf455b429c598b6d4bad155172
arch=(x86_64)
pkgdesc='The Linux kernel and modules with Masahito Suzuki BORE CPU scheduler and Arch patches'
url='https://www.kernel.org/'
license=(GPL2)
-makedepends=(bc kmod libelf pahole cpio perl tar xz xmlto git)
+makedepends=(bc cpio gettext git libelf pahole perl tar xz kmod xmlto)
+makepends+=(graphviz imagemagick python-sphinx texlive-latexextra) # htmldocs
makedepends+=(bison flex zstd make patch gcc gcc-libs glibc binutils)
if [[ "$_compiler" = "2" ]]; then
makedepends+=(clang llvm llvm-libs lld python)
@@ -64,15 +65,49 @@ options=(!strip)
archlinuxpath=https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/raw/$commit
patchpath=https://raw.githubusercontent.com/blacksky3/patches/main/$major
-patchpathbore=https://raw.githubusercontent.com/blacksky3/patches/main/
source=(https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-$_pkgver.tar.xz
${archlinuxpath}/config
- # PRJC patch
- 0001-linux6.1.y-bore2.4.0.patch
- 0002-constgran-vanilla-max.patch
+ # Bore patch
+ ${patchpath}/sirlucjan/bore/bore/0001-linux6.4-bore2.4.1.patch
# Arch patches
- 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch)
+ ${patchpath}/arch/v6.4-arch1/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
+ # Other patches
+ # Sirlucjan
+ ${patchpath}/sirlucjan/0001-bfq-cachyos-patches-v1.patch
+ ${patchpath}/sirlucjan/0001-block-set-rq_affinity-to-force-full-multithreading-I-v1.patch
+ ${patchpath}/sirlucjan/0001-btrfs-6.4-merge-changes-from-dev-tree-v1.patch
+ ${patchpath}/sirlucjan/0001-drm-6.4-Add-HDR-patches-v1.patch
+ ${patchpath}/sirlucjan/0001-hid-6.4-merge-changes-from-dev-tree-v1.patch
+ ${patchpath}/sirlucjan/0001-x86-Avoid-relocation-information-in-final-vmlinux-v1.patch
+ ${patchpath}/sirlucjan/0001-zstd-6.4-import-v1.5.5-v1.patch
+ ${patchpath}/sirlucjan/0001-zstd-modules-cachyos-patches-v1.patch
+ # TKG
+ ${patchpath}/tkg/0001-mm-Support-soft-dirty-flag-reset-for-VA-range.patch
+ ${patchpath}/tkg/0002-mm-Support-soft-dirty-flag-read-with-reset.patch
+ ${patchpath}/tkg/0013-optimize_harder_O3.patch
+ # Xanmod
+ ${patchpath}/xanmod/0001-PCI-Enable-overrides-for-missing-ACS-capabilities.patch
+ ${patchpath}/xanmod/0001-futex-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-opcode.patch
+ ${patchpath}/xanmod/0001-winesync-Introduce-the-winesync-driver-and-character.patch
+ ${patchpath}/xanmod/0001-x86-kconfig-more-uarches-for-kernel-5.17-xm_rev2.patch
+ ${patchpath}/xanmod/0001-XANMOD-x86-build-Add-more-x86_64-optimizations.patch
+ ${patchpath}/xanmod/0002-XANMOD-Makefile-Move-ARM-and-x86-instruction-set-sel.patch\
+ #${patchpath}/xanmod/0002-XANMOD-fair-Remove-all-energy-efficiency-functions.patch
+ #${patchpath}/xanmod/0003-XANMOD-fair-Increase-wake-up-granularity-time-to-3ms.patch
+ ${patchpath}/xanmod/0011-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch
+ ${patchpath}/xanmod/0012-XANMOD-mm-vmscan-vm_swappiness-30-decreases-the-amou.patch
+ ${patchpath}/xanmod/0016-XANMOD-Makefile-Disable-GCC-vectorization-on-trees.patch
+ # Xanmod Intel
+ #${patchpath}/xanmod/intel/0001-sched-fair-Record-the-average-duration-of-a-task.patch
+ #${patchpath}/xanmod/intel/0002-sched-fair-Introduce-SIS_CURRENT-to-wake-up-short-ta.patch
+ ${patchpath}/xanmod/intel/0003-x86-vdso-Use-lfence-instead-of-rep-and-nop.patch
+ ${patchpath}/xanmod/intel/0004-sched-wait-Do-accept-in-LIFO-order-for-cache-efficie.patch
+ ${patchpath}/xanmod/intel/0005-intel_rapl-Silence-rapl-trace-debug.patch
+ ${patchpath}/xanmod/intel/0006-firmware-Enable-stateless-firmware-loading.patch
+ ${patchpath}/xanmod/intel/0007-locking-rwsem-spin-faster.patch
+ ${patchpath}/xanmod/intel/0008-drivers-initialize-ata-before-graphics.patch
+ ${patchpath}/xanmod/intel/0009-init-wait-for-partition-and-retry-scan.patch)
export KBUILD_BUILD_HOST=archlinux
export KBUILD_BUILD_USER=$pkgbase
@@ -173,8 +208,91 @@ prepare(){
sleep 2s
+ msg "Apply config from Cachyos"
+
+ # NUMA is optimized for multi-socket motherboards.
+ # A single multi-core CPU actually runs slower with NUMA enabled.
+ # See, https://bugs.archlinux.org/task/31187
+ msg2 "Disable NUMA"
+ scripts/config --disable CONFIG_NUMA
+ scripts/config --disable CONFIG_AMD_NUMA
+ scripts/config --disable CONFIG_X86_64_ACPI_NUMA
+ scripts/config --disable CONFIG_NODES_SPAN_OTHER_NODES
+ scripts/config --disable CONFIG_NUMA_EMU
+ scripts/config --disable CONFIG_USE_PERCPU_NUMA_NODE_ID
+ scripts/config --disable CONFIG_ACPI_NUMA
+ scripts/config --disable CONFIG_ARCH_SUPPORTS_NUMA_BALANCING
+ scripts/config --disable CONFIG_NODES_SHIFT
+ scripts/config --disable CONFIG_NODES_SHIFT
+ scripts/config --disable CONFIG_NEED_MULTIPLE_NODES
+ scripts/config --disable CONFIG_NUMA_BALANCING
+ scripts/config --disable CONFIG_NUMA_BALANCING_DEFAULT_ENABLED
+
+ sleep 2s
+
+ # Disable debug to lower the size of the kernel
+ msg2 "Disable debug to lower the size of the kernel"
+ scripts/config --disable CONFIG_DEBUG_INFO
+ scripts/config --disable CONFIG_DEBUG_INFO_BTF
+ scripts/config --disable CONFIG_DEBUG_INFO_DWARF4
+ scripts/config --disable CONFIG_DEBUG_INFO_DWARF5
+ scripts/config --disable CONFIG_PAHOLE_HAS_SPLIT_BTF
+ scripts/config --disable CONFIG_DEBUG_INFO_BTF_MODULES
+ scripts/config --disable CONFIG_SLUB_DEBUG
+ scripts/config --disable CONFIG_PM_DEBUG
+ scripts/config --disable CONFIG_PM_ADVANCED_DEBUG
+ scripts/config --disable CONFIG_PM_SLEEP_DEBUG
+ scripts/config --disable CONFIG_ACPI_DEBUG
+ scripts/config --disable CONFIG_SCHED_DEBUG
+ scripts/config --disable CONFIG_LATENCYTOP
+ scripts/config --disable CONFIG_DEBUG_PREEMPT
+
+ sleep 2s
+
+ msg "Apply config from linux-prjc (AUR)"
+
+ # Disable CONFIG_DEBUG_INFO=y at build time otherwise memory usage blows up
+ # And can easily overwhelm a system with 32 GB of memory using a tmpfs build
+ # partition ... this was introduced by FS#66260, see:
+ # https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/linux&id=663b08666b269eeeeaafbafaee07fd03389ac8d7
+ msg2 "Disable debug to lower the size of the kernel"
+ scripts/config --disable CONFIG_CGROUP_BPF
+ scripts/config --disable CONFIG_BPF_LSM
+ scripts/config --disable CONFIG_BPF_PRELOAD
+ scripts/config --disable CONFIG_BPF_LIRC_MODE2
+ scripts/config --disable CONFIG_BPF_KPROBE_OVERRIDE
+
+ sleep 2s
+
+ # https://gitlab.com/alfredchen/linux-prjc/-/issues/81
+ # Disable mellanox module
+ msg2 "Disable mellanox module"
+ scripts/config --disable CONFIG_MLX5_CORE
+
+ sleep 2s
+
msg "Patch addition config"
+ msg2 "Enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE (O3) (0013-optimize_harder_O3.patch) (Replace O2 by O3)"
+ scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_SIZE
+ scripts/config --enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
+
+ sleep 2s
+
+ msg2 "Enable Winesync"
+ scripts/config --enable CONFIG_WINESYNC
+
+ sleep 2s
+
+ msg2 "Set ZSTD modules and kernel compression level"
+ scripts/config --enable CONFIG_KERNEL_ZSTD
+ scripts/config --set-val CONFIG_ZSTD_COMP_VAL 19
+ scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LVL 19
+ scripts/config --enable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA
+ scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL_ULTRA 22
+
+ sleep 2s
+
msg2 "Enable BORE CPU scheduler"
scripts/config --enable CONFIG_SCHED_BORE
@@ -182,7 +300,7 @@ prepare(){
plain ""
- msg2 "Supress depmod"
+ msg "Supress depmod"
sed -i '2iexit 0' scripts/depmod.sh
sleep 2s
@@ -190,7 +308,7 @@ prepare(){
plain ""
# Setting localversion
- msg2 "Setting localversion..."
+ msg "Setting localversion..."
# --save-scmversion as been removed in upstream
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/scripts/setlocalversion?h=v6.3-rc1&id=f6e09b07cc12a4d104bb19fe7566b0636f60c413
# scripts/setlocalversion --save-scmversion
@@ -208,7 +326,7 @@ prepare(){
plain ""
make -s kernelrelease > version
- msg2 "Prepared $pkgbase version $(<version)"
+ msg "Prepared $pkgbase version $(<version)"
plain ""
}
@@ -226,8 +344,8 @@ build(){
}
_package(){
- pkgdesc='The Linux kernel and modules with Masahito Suzuki BORE CPU scheduler and Arch patches'
- depends=(coreutils kmod initramfs)
+ pkgdesc='The Linux kernel and modules with Masahito Suzuki BORE CPU scheduler with Arch and other improvement patches'
+ depends=(coreutils initramfs kmod)
optdepends=('wireless-regdb: to set the correct wireless channels of your country'
'linux-firmware: firmware images needed for some devices')
provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE KSMBD-MODULE)
@@ -249,8 +367,12 @@ _package(){
msg2 "Installing modules..."
if [[ "$_compiler" = "1" ]]; then
+ # ZSTD_CLEVEL=19
+ # Keep it not far away Arch use it in official repo, since we use sirlucjan xstd patch
make ARCH=${ARCH} ${BUILD_FLAGS[*]} INSTALL_MOD_PATH="${pkgdir}"/usr INSTALL_MOD_STRIP=1 -j$(nproc) modules_install
elif [[ "$_compiler" = "2" ]]; then
+ # ZSTD_CLEVEL=19
+ # Keep it not far away Arch use it in official repo, since we use sirlucjan xstd patch
make ARCH=${ARCH} ${BUILD_FLAGS[*]} INSTALL_MOD_PATH="${pkgdir}"/usr INSTALL_MOD_STRIP=1 -j$(nproc) modules_install
fi
@@ -343,10 +465,36 @@ _package-headers(){
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
}
-sha256sums=('4323d421250e2e444c35d36f4aa8ddb56591dedc25c68d359d19c4ef9dd20955'
- '6508516de94ed941ae755d89807610dc51fe1229dbfecdf8a82604a8d33242ce'
- 'e788c1d25df2ffa710c3be4786dd477a82e8271d2950ddca89b56957035b4a5f'
- '466d7231d2bba65edb53da48e0ec444499e4ba526e9067b517fb78bf09973486'
- 'd4edb692d0a1772af639730d898282e92a3c06acc46e5a55429315b2a5763e82')
+sha256sums=('8fa0588f0c2ceca44cac77a0e39ba48c9f00a6b9dc69761c02a5d3efac8da7f3'
+ 'ab8e459ac900f4f2b2677d9692177afdfb215e75b8315259ef8bdd0a1ea032e1'
+ '1d4d837c52015895a6dfa982116396ef198f92b7a85b096e9579f5c3fb1bb2fb'
+ 'db411b01a5896283fdaf1cf30733d41e9740320a3f422b23ee8b376b8a5e8930'
+ '12de7fe29e482e6f0edfd48123c468a309b69d3cca1be4a773c1b96ef6697d22'
+ '5d0faf58c6c9e58d709ec2e136bdd576ebd4c0f7d630bef5a05bf188dd482579'
+ '2cab3863f3e21a8f8e83b3f86743c57c3f37bf086cc01ebf4573c218df229655'
+ '5b9a5d0c5c81960d981d01febe201689794b58bb835b2cadadfbdda42b74f47f'
+ '0867b5cb21a0765fd7b76d3724fc8a258bedbba974b6e4dbd62348f6ce7d9cee'
+ '81cc1547d62933e04aed15c57b9e93101e546298b1fef5f63a6b1469471acebe'
+ 'dd20963020f83e30497ebeccdeace10e98b74ebffa5847de334eeaaae80f5046'
+ 'de7a2748545b2b5d0082c09373c14d9ee41110dfa5e30a3be02e3500c2a8118c'
+ '7c913c3b58001d3534b1f1828e920ca61707b545c228714420237af51f2ec77b'
+ '1fbf26545a49ce297434fa2c39217361cdd90285b2c5ff04c505008037ede6c5'
+ '85669071475af9e4ca74cb15c1f277dadd5ea7b3050f443712da77230a4aa488'
+ 'b4b4f1c20891d1b104354dd574dda80d2f3c5e4f49c76f361c058ffb5b973fd4'
+ '4fd244250dad9949dffad6a42b702384c1b1197297f87ffe80cb45496c29cb25'
+ 'f440d27364ad757ea3cf36454a590f0329f8a6e29f630aa497705840f72e214a'
+ '75b4f9c09aeaa34f14677ccf8dffe30d786b12235eaf4a0cd9654eaa14e63bbb'
+ '5756ce78a788e58f6986640f4699bdb0672742e264b8702997ef5e7feadfc6db'
+ 'f3008b53ec36dba2d71640d8605f6cbf4c5951beadb62f1b614eeefd74d7bdb2'
+ '71e4fae21123107f00b5e08f0345591f41c61aa918d3e3680c025ce3a78a8a64'
+ '9a1eb034d4a142be9686835d47ebe1998d8f618436756c89b4521fa1a7f13e0f'
+ 'ab6409a7a582ef65bd44519bc56b06eb796c450468a88c7d4fdd67f972488b1b'
+ '1e8d4ddba087aeac79c54acee0f37b4ee5d2c7f43f064b2c8cf29d668f798e3f'
+ '6579c78554b1f1e97a6a439b4287cd542747208774af4070b6d116456e575429'
+ '0ad556c65afca9688ea495106c632d7e479e60e4e2241007a7ef4120f65b27a0'
+ '217791179fcf7d522ed8065b4cf49fb9097522b936a8852901dde0702ea90954'
+ '9a0fd7b40032514b83ec200cd7aeffccf835889c4b86c012e1b9f50fffbfd1a2'
+ '8b7be40de00645ca42ee5c7079bf7d7531de75ecdff97a30914d5d604d7efb58'
+ '7352643e67f651d322b2443e25f7b6ab30a667e3dde6fc2688cb75c24ef0ae84')
# vim:set ts=8 sts=2 sw=2 et: