Archlinux Kernel based on different schedulers and some other performance improvements.
Shell archlinuxbaby-schedcachycachy-schedulercachyoscacule-schedkernellinux-kernelperformanceperformance-tuning
add 5.19 rt kernel
Peter Jung5ef8dc3dfd74
diff --git a/linux-cachyos-rt-rc/.SRCINFO b/linux-cachyos-rt/.SRCINFOsimilarity index 64%rename from linux-cachyos-rt-rc/.SRCINFOrename to linux-cachyos-rt/.SRCINFOindex 90ddbc79..e5cc80ef 100644--- a/linux-cachyos-rt-rc/.SRCINFO+++ b/linux-cachyos-rt/.SRCINFO@@ -1,6 +1,6 @@-pkgbase = linux-cachyos-rt-rc- pkgdesc = Linux BORE-RT scheduler Kernel by CachyOS and with some other patches and other improvements- pkgver = 5.20.rc1+pkgbase = linux-cachyos-bore+ pkgdesc = Linux BORE scheduler Kernel by CachyOS with other patches and improvements+ pkgver = 5.19.0pkgrel = 1url = https://github.com/CachyOS/linux-cachyosarch = x86_64@@ -21,19 +21,19 @@ pkgbase = linux-cachyos-rt-rcmakedepends = makemakedepends = patchoptions = !strip- source = https://github.com/torvalds/linux/archive/refs/tags/v5.20-rc1.tar.gz+ source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.19.tar.xzsource = configsource = auto-cpu-optimization.sh- source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.20/all/0001-cachyos-base-rt-all.patch- source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.20/sched/0001-bore.patch- sha256sums = 1f52eb88e511c3b7f7e3373418195f0db5d2acf9ff7623554371537bf785399a+ source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.19/all/0001-cachyos-base-rt-all.patch+ source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.19/sched/0001-bore.patch+ sha256sums = ff240c579b9ee1affc318917de07394fc1c3bb49dac25ec1287370c2e15005a8sha256sums = d32897c6ea7f685f511692552eab0b4208f06f1b287b83393f1fc3ed2d9a0516sha256sums = ce8bf7807b45a27eed05a5e1de5a0bf6293a3bbc2085bacae70cd1368f368d1f- sha256sums = 0844e475b66675bbb09a80cd3d52d4ebccd2e708af28661ce5414ef4a39f2818+ sha256sums = 8b79bee8931230ca4c6c384280e3e514bfb5f62275af10b80dacb965b9ec28f8sha256sums = 0fe7f1698639df033709c6d32e651d378fc6e320dfc6387f8aee83d9ed0231a8-pkgname = linux-cachyos-rt-rc- pkgdesc = The Linux BORE-RT scheduler Kernel by CachyOS and with some other patches and other improvements kernel and modules+pkgname = linux-cachyos-bore+ pkgdesc = The Linux BORE scheduler Kernel by CachyOS with other patches and improvements kernel and modulesdepends = coreutilsdepends = kmoddepends = initramfs@@ -46,7 +46,7 @@ pkgname = linux-cachyos-rt-rcprovides = KSMBD-MODULEprovides = UKSMD-BUILTIN-pkgname = linux-cachyos-rt-rc-headers- pkgdesc = Headers and scripts for building modules for the Linux BORE-RT scheduler Kernel by CachyOS and with some other patches and other improvements kernel+pkgname = linux-cachyos-bore-headers+ pkgdesc = Headers and scripts for building modules for the Linux BORE scheduler Kernel by CachyOS with other patches and improvements kerneldepends = pahole- depends = linux-cachyos-rt-rc+ depends = linux-cachyos-borediff --git a/linux-cachyos-rt-rc/PKGBUILD b/linux-cachyos-rt/PKGBUILDsimilarity index 90%rename from linux-cachyos-rt-rc/PKGBUILDrename to linux-cachyos-rt/PKGBUILDindex 7284fbfd..b8677098 100644--- a/linux-cachyos-rt-rc/PKGBUILD+++ b/linux-cachyos-rt/PKGBUILD@@ -19,7 +19,7 @@ _cpusched='bore'# Set these variables to ANYTHING that is not null to enable them### Tweak kernel options prior to a build via nconfig-_makenconfig=y+_makenconfig=# NUMA is optimized for multi-socket motherboards.# A single multi-core CPU actually runs slower with NUMA enabled.@@ -43,6 +43,9 @@ _localmodcfg=# a new kernel is released, but again, convenient for package bumps._use_current=+### Enable KBUILD_CFLAGS -O3+_cc_harder=y+### Set performance governor as default_per_gov=y@@ -57,7 +60,7 @@ _HZ_ticks=750_tickrate=full## Choose between full(low-latency), voluntary or server-#_preempt=+#_preempt=full### Disable MQ-Deadline I/O scheduler_mq_deadline_disable=y@@ -97,8 +100,6 @@ _disable_debug=y## Enable zram/zswap ZSTD compression_zstd_compression=y-_nf_cone=y-# Clang LTO mode, only available with the "llvm" compiler - options are "no", "full" or "thin".# "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains."# "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full."@@ -112,6 +113,7 @@ _use_llvm_lto=# ATTENTION!: you do need a patched llvm for the usage of kcfi,# you can find a patched llvm-git in the cachyos-repo's.# The packagename is called "llvm-kcfi"+# ATTENTION!: This is very experimental and could fail and the compilation or have other bugs in the kernel_use_kcfi=# Build the zfs module builtin in to the kernel@@ -121,27 +123,24 @@ _build_zfs=_bcachefs=if [ -n "$_use_llvm_lto" ]; then- pkgsuffix=cachyos-rt-rc-lto+ pkgsuffix=cachyos-${_cpusched}-ltopkgbase=linux-$pkgsuffixelse- pkgsuffix=cachyos-rt-rc+ pkgsuffix=cachyos-${_cpusched}pkgbase=linux-$pkgsuffixfi-_major=5.20+_major=5.19_minor=0#_minorc=$((_minor+1))-_rcver=rc1-## We include the rt patch in our all patch-#_rtver=9-#_rtpatchver=rt${_rtver}-pkgver=${_major}.${_rcver}+#_rcver=rc8+pkgver=${_major}.${_minor}#_stable=${_major}.${_minor}-#_stable=${_major}-_stable=${_major}-${_rcver}+_stable=${_major}+#_stablerc=${_major}-${_rcver}_srcname=linux-${_stable}#_srcname=linux-${_major}-pkgdesc='Linux BORE-RT scheduler Kernel by CachyOS and with some other patches and other improvements'+pkgdesc='Linux BORE scheduler Kernel by CachyOS with other patches and improvements'pkgrel=1_kernver=$pkgver-$pkgrelarch=('x86_64' 'x86_64_v3')@@ -166,7 +165,7 @@ if [ -n "$_build_zfs" ]; thenfi_patchsource="https://raw.githubusercontent.com/ptr1337/kernel-patches/master/${_major}"source=(- "https://github.com/torvalds/linux/archive/refs/tags/v${_major}-${_rcver}.tar.gz"+ "https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/${_srcname}.tar.xz""config""auto-cpu-optimization.sh""${_patchsource}/all/0001-cachyos-base-rt-all.patch")@@ -205,7 +204,7 @@ if [ "$_cpusched" = "hardened" ]; thenfi## Kernel CFI Patchif [ -n "$_use_kcfi" ]; then- source+=("${_patchsource}/0001-kcfi.patch")+ source+=("${_patchsource}/misc/0001-kcfi.patch")depends+=(llvm-git llvm-libs-git python)BUILD_FLAGS=(CC=clang@@ -215,7 +214,7 @@ if [ -n "$_use_kcfi" ]; thenfi## bcachefs Supportif [ -n "$_bcachefs" ]; then- source+=("${_patchsource}/0001-bcachefs-after-lru.patch")+ source+=("${_patchsource}/misc/0001-bcachefs-after-lru.patch")fiexport KBUILD_BUILD_HOST=archlinux@@ -432,43 +431,43 @@ prepare() {exitfi- ### Select preempt type ## commented for RT-# if [ "$_preempt" = "full" ]; then-# echo "Enabling low latency preempt..."-# scripts/config --enable PREEMPT_BUILD \-# --disable PREEMPT_NONE \-# --disable PREEMPT_VOLUNTARY \-# --enable PREEMPT \-# --enable PREEMPT_COUNT \-# --enable PREEMPTION \-# --enable PREEMPT_DYNAMIC-# elif [ "$_preempt" = "voluntary" ]; then-# echo "Enabling voluntary preempt..."-# scripts/config --enable PREEMPT_BUILD \-# --disable PREEMPT_NONE \-# --enable PREEMPT_VOLUNTARY \-# --disable PREEMPT \-# --enable PREEMPT_COUNT \-# --enable PREEMPTION \-# --disable PREEMPT_DYNAMIC-# elif [ "$_preempt" = "server" ]; then-# echo "Enabling server preempt..."-# scripts/config --enable PREEMPT_NONE_BUILD \-# --enable PREEMPT_NONE \-# --disable PREEMPT_VOLUNTARY \-# --disable PREEMPT \-# --disable PREEMPT_COUNT \-# --disable PREEMPTION \-# --disable PREEMPT_DYNAMIC-# else-# if [ -n "$_preempt" ]; then-# error "The value $_preempt is invalid. Choose the correct one again."-# else-# error "The value is empty. Choose the correct one again."-# fi-# error "Selecting PREEMPT failed!"-# exit-# fi+ ### Select preempt type+ if [ "$_preempt" = "full" ]; then+ echo "Enabling low latency preempt..."+ scripts/config --enable PREEMPT_BUILD \+ --disable PREEMPT_NONE \+ --disable PREEMPT_VOLUNTARY \+ --enable PREEMPT \+ --enable PREEMPT_COUNT \+ --enable PREEMPTION \+ --enable PREEMPT_DYNAMIC+ elif [ "$_preempt" = "voluntary" ]; then+ echo "Enabling voluntary preempt..."+ scripts/config --enable PREEMPT_BUILD \+ --disable PREEMPT_NONE \+ --enable PREEMPT_VOLUNTARY \+ --disable PREEMPT \+ --enable PREEMPT_COUNT \+ --enable PREEMPTION \+ --disable PREEMPT_DYNAMIC+ elif [ "$_preempt" = "server" ]; then+ echo "Enabling server preempt..."+ scripts/config --enable PREEMPT_NONE_BUILD \+ --enable PREEMPT_NONE \+ --disable PREEMPT_VOLUNTARY \+ --disable PREEMPT \+ --disable PREEMPT_COUNT \+ --disable PREEMPTION \+ --disable PREEMPT_DYNAMIC+ else+ if [ -n "$_preempt" ]; then+ error "The value $_preempt is invalid. Choose the correct one again."+ else+ error "The value is empty. Choose the correct one again."+ fi+ error "Selecting PREEMPT failed!"+ exit+ fi### Enable O3if [ -n "$_cc_harder" ]; then@@ -487,13 +486,6 @@ prepare() {--set-str DEFAULT_TCP_CONG bbr2fi- ### Enable FULLCONENAT- if [ -n "$_nf_cone" ]; then- echo "Enabling FULLCONENAT..."- scripts/config --module IP_NF_TARGET_FULLCONENAT \- --module NETFILTER_XT_TARGET_FULLCONENAT- fi-### Select LRU configif [ "$_lru_config" = "standard" ]; thenecho "Enabling multigenerational LRU..."@@ -605,12 +597,7 @@ prepare() {### Enable ZSTD swap/zram compressionif [ -n "$_zstd_swap_compression" ]; thenecho "Enabling zram ZSTD compression..."- scripts/config --disable ZRAM_DEF_COMP_LZORLE \- --enable ZRAM_DEF_COMP_ZSTD \- --set-str ZRAM_DEF_COMP zstd \- --disable ZSWAP_COMPRESSOR_DEFAULT_LZ4 \- --enable ZSWAP_COMPRESSOR_DEFAULT_ZSTD \- --set-str ZSWAP_COMPRESSOR_DEFAULT zstd \+ scripts/config --disable CONFIG_ZSWAP_DEFAULT_ON \--enable ZRAM_ENTROPY \--set-val ZRAM_ENTROPY_THRESHOLD 100000fi@@ -683,9 +670,6 @@ prepare() {echo "Save configuration for later reuse..."cat .config > "${startdir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"- ### Save configuration for later reuse- # cp -Tf ./.config "${startdir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"-}build() {@@ -833,8 +817,8 @@ _package-zfs(){depends=('pahole' linux-$pkgsuffix=$_kernver)cd ${srcdir}/"zfs"- install -dm755 "$pkgdir/usr/lib/modules/${_major}.${_minor}-${_rcver}-${pkgrel}-${pkgsuffix}"- install -m644 module/*/*.ko "$pkgdir/usr/lib/modules/${_major}.${_minor}-${_rcver}-${pkgrel}-${pkgsuffix}"+ install -dm755 "$pkgdir/usr/lib/modules/${_kernver}-${pkgsuffix}"+ install -m644 module/*/*.ko "$pkgdir/usr/lib/modules/${_kernver}-${pkgsuffix}"find "$pkgdir" -name '*.ko' -exec zstd --rm -10 {} +# sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${pkgver}-${pkgbase}'/" "$startdir/zfs.install"}@@ -850,8 +834,8 @@ for _p in "${pkgname[@]}"; do}"done-sha256sums=('1f52eb88e511c3b7f7e3373418195f0db5d2acf9ff7623554371537bf785399a'+sha256sums=('ff240c579b9ee1affc318917de07394fc1c3bb49dac25ec1287370c2e15005a8''d32897c6ea7f685f511692552eab0b4208f06f1b287b83393f1fc3ed2d9a0516''ce8bf7807b45a27eed05a5e1de5a0bf6293a3bbc2085bacae70cd1368f368d1f'- '0844e475b66675bbb09a80cd3d52d4ebccd2e708af28661ce5414ef4a39f2818'+ '8b79bee8931230ca4c6c384280e3e514bfb5f62275af10b80dacb965b9ec28f8''0fe7f1698639df033709c6d32e651d378fc6e320dfc6387f8aee83d9ed0231a8')diff --git a/linux-cachyos-rt-rc/auto-cpu-optimization.sh b/linux-cachyos-rt/auto-cpu-optimization.shsimilarity index 100%rename from linux-cachyos-rt-rc/auto-cpu-optimization.shrename to linux-cachyos-rt/auto-cpu-optimization.shdiff --git a/linux-cachyos-rt-rc/config b/linux-cachyos-rt/configsimilarity index 100%rename from linux-cachyos-rt-rc/configrename to linux-cachyos-rt/configdiff --git a/linux-cachyos-rt-rc/configure b/linux-cachyos-rt/configuresimilarity index 100%rename from linux-cachyos-rt-rc/configurerename to linux-cachyos-rt/configure