Compare commits

...

5 Commits

Author SHA1 Message Date
Nathan f2597b6dfc git subrepo clone https://github.com/Frogging-Family/linux-tkg
subrepo:
  subdir:   "linux-tkg"
  merged:   "3966d61"
upstream:
  origin:   "https://github.com/Frogging-Family/linux-tkg"
  branch:   "master"
  commit:   "3966d61"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-03-23 15:47:50 -05:00
Nathan 96b7006e26 update 2022-03-23 15:46:51 -05:00
Nathan 7c00a6aafc update 2022-03-21 15:27:19 -05:00
Nathan c6095e64d8 5.10.104 2022-03-14 17:58:29 -05:00
Nathan 8cb3df3b70 5.16.13 2022-03-14 15:00:05 -05:00
10 changed files with 189 additions and 11008 deletions

View File

@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/Frogging-Family/linux-tkg
branch = master
commit = 9c02feac7ab18e7edb62fa748f471752222c2b42
parent = 8f91d9e662a66e9f3cbc4c02bb90dd68eba2d22a
commit = 3966d619f77a49733eb255a22e3c586f4e3ffbed
parent = 96b7006e264bc84aac383e037274745dd3da1bfd
method = merge
cmdver = 0.4.3

View File

@ -27,7 +27,7 @@ plain ' `.-:///////:-.`'
_where="$PWD" # track basedir as different Arch based distros are moving srcdir around
_ispkgbuild="true"
_distro="Arch"
_basever=515
source "$_where"/customization.cfg # load default configuration from file
source "$_where"/linux-tkg-config/prepare
@ -57,7 +57,6 @@ if [ -n "$_custom_pkgbase" ]; then
else
pkgbase=linux"${_basever}"-tkg-"${_cpusched}"${_compiler_name}
fi
pkgbase=linux
pkgname=("${pkgbase}" "${pkgbase}-headers")
pkgver="${_basekernel}"."${_sub}"
pkgrel=247
@ -74,10 +73,8 @@ options=('!strip' 'docs')
case $_basever in
54)
#opt_ver="4.19-5.4"
source=("$kernel_site"
"$patch_site"
#"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-4.19-5.4.patch"
'config.x86_64' # stock Arch config
'config_hardened.x86_64' # hardened Arch config
90-cleanup.hook
@ -103,8 +100,7 @@ case $_basever in
0012-linux-hardened.patch
)
sha256sums=('bf338980b1670bca287f9994b7441c2361907635879169c64ae78364efc5f491'
'69c153d9d425273762df1d1f917904e0b9f765fb7a9b49ea32a27f2264a614cc'
#'SKIP'
'd58cbfc41bf8672b0ce9c9f129578c18bfecbdeb4684c581e191345cb2aa95f1'
'b0c4c60669f47ba4d3d1388368a5f9790aa697af42c917ed2ef177f111336d8b'
'1f4a20d6eaaa0d969af93152a65191492400c6aa838fc1c290b0dd29bb6019d8'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
@ -127,10 +123,8 @@ case $_basever in
'aeb31404c26ee898d007b1f66cb9572c9884ad8eca14edc4587d68f6cba6de46')
;;
57)
opt_ver="5.7"
source=("$kernel_site"
"$patch_site"
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/outdated_versions/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.7.patch"
'config.x86_64' # stock Arch config
'config_hardened.x86_64' # hardened Arch config
90-cleanup.hook
@ -157,7 +151,6 @@ case $_basever in
)
sha256sums=('de8163bb62f822d84f7a3983574ec460060bf013a78ff79cd7c979ff1ec1d7e0'
'66a0173a13cd58015f5bf1b14f67bfa15dc1db5d8e7225fcd95ac2e9a5341653'
'SKIP'
'357a0db541f7de924ed89c21f5a6f3de4889b134c5d05d5e32ccd234bd81eedf'
'15ce09447b7e9b28425c1df5961c955378f2829e4115037337eef347b1db3d9d'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
@ -181,10 +174,8 @@ case $_basever in
'6821f92bd2bde3a3938d17b070d70f18a2f33cae81647567b5a4d94c9cd75f3d')
;;
58)
opt_ver="5.8-5.14"
source=("$kernel_site"
"$patch_site"
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.8-5.14.patch"
'config.x86_64' # stock Arch config
#'config_hardened.x86_64' # hardened Arch config
90-cleanup.hook
@ -212,7 +203,6 @@ case $_basever in
)
sha256sums=('e7f75186aa0642114af8f19d99559937300ca27acaf7451b36d4f9b0f85cf1f5'
'5b558a40c2fdad2c497fe0b1a64679313fd5a7ccbaecef8803d49b3baaccbacd'
'SKIP'
'f4754fbe2619ef321e49a7b560fad058b2459d17cff0b90e839cb475f46e8b63'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
'66a03c246037451a77b4d448565b1d7e9368270c7d02872fbd0b5d024ed0a997'
@ -232,10 +222,8 @@ case $_basever in
'f5dbff4833a2e3ca94c202e5197894d5f1006c689ff149355353e77d2e17c943')
;;
59)
opt_ver="5.8-5.14"
source=("$kernel_site"
$patch_site
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.8-5.14.patch"
"config.x86_64" # stock Arch config
#$hardened_config_file # hardened Arch config
90-cleanup.hook
@ -263,7 +251,6 @@ case $_basever in
)
sha256sums=('3239a4ee1250bf2048be988cc8cb46c487b2c8a0de5b1b032d38394d5c6b1a06'
'46c520da2db82d8f9a15c2117d3a50e0faaaf98f05bd4ea1f3105e2724f207d6'
'SKIP'
'ce2711b9d628e71af62706b830c2f259a43ad1e614871dd90bcb99d8709e1dab'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
'66a03c246037451a77b4d448565b1d7e9368270c7d02872fbd0b5d024ed0a997'
@ -286,10 +273,8 @@ case $_basever in
'0d5fe3a9050536fe431564b221badb85af7ff57b330e3978ae90d21989fcad2d')
;;
510)
opt_ver="5.8-5.14"
source=("$kernel_site"
"$patch_site"
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.8-5.14.patch"
'config.x86_64' # stock Arch config
'config_hardened.x86_64' # hardened Arch config
90-cleanup.hook
@ -320,8 +305,7 @@ case $_basever in
0012-misc-additions.patch
)
sha256sums=('dcdf99e43e98330d925016985bfbc7b83c66d367b714b2de0cbbfcbf83d8ca43'
'3ce705c37f70db9962bd615329e34b85bc41eb3eff63284eb34e2979da05ce5b'
'SKIP'
'9be86704b6718cad866ce5dc275a22700e4e62ceb8e2913269afb0c68bec2879'
'13a39ab2be1301b60565cb6a4bedb2bca16b6b12427407c099a81169feb367d6'
'eb1da1a028a1c967222b5bdac1db2b2c4d8285bafd714892f6fc821c10416341'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
@ -350,10 +334,8 @@ case $_basever in
'7fb1104c167edb79ec8fbdcde97940ed0f806aa978bdd14d0c665a1d76d25c24')
;;
511)
opt_ver="5.8-5.14"
source=("$kernel_site"
"$patch_site"
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.8-5.14.patch"
'config.x86_64' # stock Arch config
'config_hardened.x86_64' # hardened Arch config
90-cleanup.hook
@ -387,7 +369,6 @@ case $_basever in
)
sha256sums=('04f07b54f0d40adfab02ee6cbd2a942c96728d87c1ef9e120d0cb9ba3fe067b4'
'07aac31956d3f483a91506524befd45962f3bbfda2f8d43cf90713caf872d9ba'
'SKIP'
'fc08ac33e3bc47ed0ee595a2e4b84bc45b02682b383db6acfe281792e88f6231'
'837ad05b68d0443580f78f5eb316db46c6b67abfefa66c22b6cb94f4915a52ba'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
@ -417,10 +398,8 @@ case $_basever in
'b0319a7dff9c48b2f3e3d3597ee154bf92223149a633a8b7ce4026252db86da6')
;;
512)
opt_ver="5.8-5.14"
source=("$kernel_site"
"$patch_site"
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.8-5.14.patch"
'config.x86_64' # stock Arch config
#'config_hardened.x86_64' # hardened Arch config
90-cleanup.hook
@ -455,7 +434,6 @@ case $_basever in
)
sha256sums=('7d0df6f2bf2384d68d0bd8e1fe3e071d64364dcdc6002e7b5c87c92d48fac366'
'a41e4a4eb50c670a48f9c9bcc32ccb2195c02e3caa823a6aaed04537fdd8b73d'
'SKIP'
'0a7c40402715f8817c4f40173ca1fa8af84c56f7658be281e5424319000370b6'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
'66a03c246037451a77b4d448565b1d7e9368270c7d02872fbd0b5d024ed0a997'
@ -481,10 +459,8 @@ case $_basever in
'b0319a7dff9c48b2f3e3d3597ee154bf92223149a633a8b7ce4026252db86da6')
;;
513)
opt_ver="5.8-5.14"
source=("$kernel_site"
"$patch_site"
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.8-5.14.patch"
'config.x86_64' # stock Arch config
'config_hardened.x86_64' # hardened Arch config
90-cleanup.hook
@ -518,7 +494,6 @@ case $_basever in
)
sha256sums=('3f6baa97f37518439f51df2e4f3d65a822ca5ff016aa8e60d2cc53b95a6c89d9'
'6fadc31348a0c0bbce86b067811d1dadae307bbde5b712c688b3193d73f0fb71'
'SKIP'
'06ad99b810943f7ce4650fe656156f4b40d11fabd9b89e2b1beff06c46836efc'
'49a34dfc8ee7663a8a20c614f086e16ec70e8822db27a91050fd6ffebf87a650'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
@ -548,10 +523,8 @@ case $_basever in
'b0319a7dff9c48b2f3e3d3597ee154bf92223149a633a8b7ce4026252db86da6')
;;
514)
opt_ver="5.8-5.14"
source=("$kernel_site"
"$patch_site"
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.8-5.14.patch"
'config.x86_64' # stock Arch config
#'config_hardened.x86_64' # hardened Arch config
90-cleanup.hook
@ -582,7 +555,6 @@ case $_basever in
)
sha256sums=('7e068b5e0d26a62b10e5320b25dce57588cbbc6f781c090442138c9c9c3271b2'
'578be613998d8aa7e5460d6d5448799e422198d31e157c67eec2e5e58abb9c60'
'SKIP'
'f5d3635520c9eb9519629f6df0d9a58091ed4b1ea4ddb1acd5caf5822d91a060'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
'66a03c246037451a77b4d448565b1d7e9368270c7d02872fbd0b5d024ed0a997'
@ -606,10 +578,8 @@ case $_basever in
'b0319a7dff9c48b2f3e3d3597ee154bf92223149a633a8b7ce4026252db86da6')
;;
515)
opt_ver="5.15%2B"
source=("$kernel_site"
"$patch_site"
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.15%2B.patch"
'config.x86_64' # stock Arch config
'config_hardened.x86_64' # hardened Arch config
90-cleanup.hook
@ -638,8 +608,7 @@ case $_basever in
0002-mm-Support-soft-dirty-flag-read-with-reset.patch
)
sha256sums=('57b2cf6991910e3b67a1b3490022e8a0674b6965c74c12da1e99d138d1991ee8'
'ab323e0994a6bf1e8116a0e26c8e64edba87c7d85ec99f00380fdc11168dcda4'
'SKIP'
'ca7eb4581e0009e24f158c56ca98692f15a090fee6e3e645db906afe9301dd1b'
'24be2e8863e265195a24d7082804cd4328fd9f0a31b88672c884b9fd42469ed8'
'6e3ef6bc4779ae3b7154642147d5ab3ece6e38e3e08bdb30f86d89d2b4855fa9'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
@ -665,10 +634,8 @@ case $_basever in
'b0319a7dff9c48b2f3e3d3597ee154bf92223149a633a8b7ce4026252db86da6')
;;
516)
opt_ver="5.15%2B"
source=("$kernel_site"
"$patch_site"
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.15%2B.patch"
'config.x86_64' # stock Arch config
#'config_hardened.x86_64' # hardened Arch config
90-cleanup.hook
@ -696,8 +663,7 @@ case $_basever in
0002-mm-Support-soft-dirty-flag-read-with-reset.patch
)
sha256sums=('027d7e8988bb69ac12ee92406c3be1fe13f990b1ca2249e226225cd1573308bb'
'aaa5555a903f794fb753f35427781b608d72ea34993c018ae1289037376037a0'
'SKIP'
'e31bc94a75f9b8385bb3b3f48ddaeb830117ec875210819466ecbdf9502050fd'
'5b54e733edceca75df8d7c44aee4a811f3d058861ce54ab0839a7705d47e59df'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
'66a03c246037451a77b4d448565b1d7e9368270c7d02872fbd0b5d024ed0a997'
@ -720,10 +686,8 @@ case $_basever in
'b0319a7dff9c48b2f3e3d3597ee154bf92223149a633a8b7ce4026252db86da6')
;;
517)
opt_ver="5.15%2B"
source=("$kernel_site"
#"$patch_site"
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.15%2B.patch"
'config.x86_64' # stock Arch config
#'config_hardened.x86_64' # hardened Arch config
90-cleanup.hook
@ -750,9 +714,8 @@ case $_basever in
0001-mm-Support-soft-dirty-flag-reset-for-VA-range.patch
0002-mm-Support-soft-dirty-flag-read-with-reset.patch
)
sha256sums=('35575d4843f405ddd229f358a81fecca460fcd7a4b087bd74f0a34cc4c20b2c1'
sha256sums=('555fef61dddb591a83d62dd04e252792f9af4ba9ef14683f64840e46fa20b1b1'
#upcoming_kernel_patch_sha256
'SKIP'
'961c380f74b9e28a47a21001fc330460dcd639f7580b7a178472e40af8f4dcd4'
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
'66a03c246037451a77b4d448565b1d7e9368270c7d02872fbd0b5d024ed0a997'
@ -768,7 +731,7 @@ case $_basever in
'f91223f98f132602a4fa525917a1f27afe30bdb55a1ac863e739c536188417b3'
'9fad4a40449e09522899955762c8928ae17f4cdaa16e01239fd12592e9d58177'
'a557b342111849a5f920bbe1c129f3ff1fc1eff62c6bd6685e0972fc88e39911'
'cfaa1a7efd24fb7967511ae0423362d33631bf355516c6ef524403e8e343e448'
'5d8aa3d707982e324d3ce8fcc5f832035d8155dc703f0125bbaa21cd87ce26f3'
#'decd4a55c0d47b1eb808733490cdfea1207a2022d46f06d04a3cc60fdcb3f32c'
'1aa0a172e1e27fb8171053f3047dcf4a61bd2eda5ea18f02b2bb391741a69887'
'1b656ad96004f27e9dc63d7f430b50d5c48510d6d4cd595a81c24b21adb70313'
@ -820,6 +783,7 @@ build() {
# remove -O2 flag and place user optimization flag
CFLAGS=${CFLAGS/-O2/}
CFLAGS+=" ${_compileropt}"
# build!
_runtime=$( time ( schedtool -B -n 1 -e ionice -n 1 make ${_force_all_threads} ${llvm_opt} LOCALVERSION= bzImage modules 2>&1 ) 3>&1 1>&2 2>&3 ) || _runtime=$( time ( make ${_force_all_threads} ${llvm_opt} LOCALVERSION= bzImage modules 2>&1 ) 3>&1 1>&2 2>&3 )
}

View File

@ -90,6 +90,8 @@ makepkg -si
```
The script will use a slightly modified Arch config from the `linux-tkg-config` folder, it can be changed through the `_configfile` variable in `customization.cfg`. The options selected at build-time are installed to `/usr/share/doc/$pkgbase/customization.cfg`, where `$pkgbase` is the package name.
**Note:** the `base-devel` package group is expected to be installed, see [here](https://wiki.archlinux.org/title/Makepkg) for more information.
#### DEB (Debian, Ubuntu and derivatives) and RPM (Fedora, SUSE and derivatives) based distributions
The interactive `install.sh` script will create, depending on the selected distro, `.deb` or `.rpm` packages, move them in the the subfolder `DEBS` or `RPMS` then prompts to install them with the distro's package manager.
```shell

View File

@ -229,6 +229,9 @@ _tcp_cong_alg=""
# You can pass a default set of kernel command line options here - example: "intel_pstate=passive nowatchdog amdgpu.ppfeaturemask=0xfffd7fff mitigations=off"
_custom_commandline="intel_pstate=passive"
# Selection of Clearlinux patches
_clear_patches="true"
#### SPESHUL OPTION ####

View File

@ -208,28 +208,6 @@ if [ "$1" = "install" ] || [ "$1" = "config" ]; then
# Git clone (if necessary) and checkout the asked branch by the user
_linux_git_branch_checkout
cd "$_where"
if [ "$_basever" = "54" ]; then
opt_ver="4.19-5.4"
elif [ "$_basever" = "57" ]; then
opt_ver="5.7"
opt_alternative_url="true"
elif [[ "$_basever" =~ ^(58|59|510|511|512|513|514)$ ]]; then
opt_ver="5.8-5.14"
else
opt_ver="5.15+"
fi
if [ -n "$opt_ver" ]; then
msg2 "Downloading Graysky2's CPU optimisations patch"
if [ "$opt_alternative_url" != "true" ]; then
wget "https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-${opt_ver}.patch"
else
wget "https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/outdated_versions/enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v${opt_ver}.patch"
fi
fi
# cd into the linux-src folder is important before calling _tkg_srcprep
cd "$_where/linux-src-git"
_tkg_srcprep

File diff suppressed because it is too large Load Diff

View File

@ -8,18 +8,18 @@ _eol_kernels=("5.14" "5.13" "5.12" "5.11" "5.9" "5.8" "5.7")
typeset -Ag _kver_subver_map
_kver_subver_map=(
["5.4"]="183"
["5.4"]="187"
["5.7"]="19"
["5.8"]="18"
["5.9"]="16"
["5.10"]="104"
["5.10"]="108"
["5.11"]="22"
["5.12"]="19"
["5.13"]="19"
["5.14"]="21"
["5.15"]="27"
["5.16"]="13"
["5.17"]="rc7"
["5.15"]="31"
["5.16"]="17"
["5.17"]="0"
)
# PREEMPT_RT's supported kernel subversion
@ -385,16 +385,12 @@ _tkg_patcher() {
patch -Np1 -i "$tkgpatch" >> "$_where"/prepare.log || error "An error was encountered applying patches. It was logged to the prepare.log file."
echo -e "\n" >> "$_where"/prepare.log
else
msg2 "Skipping patch ${tkgpatch##*/}...\n (unavailable for this kernel version)" #"
msg2 "Skipping patch %s...\n (unavailable for this kernel version)" "${tkgpatch##*/}" #"
fi
}
_tkg_srcprep() {
if [ "${_distro}" = "Void" ] && [ -e ${srcdir}/sum_failed ]; then
exit 1
fi
msg2 "Setting version..."
scripts/setlocalversion --save-scmversion
@ -402,7 +398,6 @@ _tkg_srcprep() {
echo "-$pkgrel-tkg-${_cpusched}${_compiler_name}" > localversion.10-pkgrel
echo -e "Version tail set to \"-$pkgrel-tkg-${_cpusched}${_compiler_name}\"\n" > "$_where"/prepare.log
echo "" > localversion.20-pkgname
# add upstream patch
if [ "$_sub" != "0" ] && [[ "$_sub" != rc* ]]; then
if [ ! -e "$srcdir/patch-${pkgver}" ]; then
@ -412,10 +407,15 @@ _tkg_srcprep() {
( cd "$_where" && xz -dk patch-${pkgver}.xz && mv "$_where"/patch-${pkgver} "$srcdir"/ )
fi
fi
tkgpatch="$srcdir/patch-${pkgver}"
_msg="Patching from $_basekernel to $pkgver" && _tkg_patcher
fi
fi
if [ "${_distro}" = "Void" ]; then
pkgver="${version}"
fi
if [ "${_distro}" = "Arch" ] || [ "${_distro}" = "Void" ]; then
tkgpatch="$srcdir/patch-${pkgver}"
_msg="Patching from $_basekernel to $pkgver" && _tkg_patcher
fi
# Hardened Patches
if [ "${_configfile}" = "config_hardened.x86_64" ] && [ "${_cpusched}" = "cfs" ]; then
@ -426,40 +426,31 @@ _tkg_srcprep() {
_msg="Using Arch patches" && _tkg_patcher
fi
# Void
if [ "$_distro" = "Void" ] && [[ "$_sub" = rc* ]]; then
cd ${wrksrc}/linux-${_rc_kern_ver}
elif [ "$_distro" = "Void" ]; then
cd ${wrksrc}/linux-${_kern_ver}
fi
if [ -z $_debug ]; then
# graysky's cpu opts - https://github.com/graysky2/kernel_compiler_patch
if [ "$_basever" != "57" ]; then
# Newer version of the patches
if [ "${_distro}" = "Arch" ]; then
tkgpatch="$srcdir/more-uarches-for-kernel-${opt_ver}.patch"
elif [ "${_distro}" = "Void" ]; then
tkgpatch="${wrksrc}/more-uarches-for-kernel-${opt_ver}.patch"
else
tkgpatch="$srcdir/more-uarches-for-kernel-${opt_ver}.patch"
fi
_msg="Applying graysky's cpu opts patch" && _tkg_patcher
else
# Edge case for 5.7
if [ "${_distro}" = "Arch" ]; then
tkgpatch="$srcdir/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v${opt_ver}.patch"
elif [ "${_distro}" = "Void" ]; then
tkgpatch="${wrksrc}/enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v${opt_ver}.patch"
else
tkgpatch="$srcdir/enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v${opt_ver}+.patch"
fi
_msg="Applying graysky's cpu opts patch (legacy)" && _tkg_patcher
_patch_location="$srcdir"
if [ "${_distro}" = "Void" ]; then
_patch_location="${wrksrc}"
fi
if [ "$_basever" = "54" ]; then
_patch_name="more-uarches-for-kernel-4.19-5.4"
elif [ "$_basever" = "57" ]; then
_patch_name="outdated_versions/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.7"
elif (( 58 <= "$_basever" && "$_basever" <= 514 )); then
_patch_name="more-uarches-for-kernel-5.8-5.14"
elif [[ "$_basever" =~ ^(515|516)$ ]]; then
_patch_name="more-uarches-for-kernel-5.15-5.16"
else
_patch_name="more-uarches-for-kernel-5.17%2B"
fi
wget -O "${_patch_location}/${_patch_name}.patch" "https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/${_patch_name}.patch"
tkgpatch="${_patch_location}/${_patch_name}.patch"
_msg="Applying graysky's cpu opts patch" && _tkg_patcher
# PREEMPT_RT patch
if [ "${_preempt_rt}" = "1" ]; then
if [ ${_rt_subver_map[$_basekernel]+_} = "_" ]; then
@ -484,8 +475,10 @@ _tkg_srcprep() {
fi
# TkG
tkgpatch="$srcdir/0002-clear-patches.patch"
_msg="Applying clear linux patches" && _tkg_patcher
if [ "$_clear_patches" = "true" ]; then
tkgpatch="$srcdir/0002-clear-patches.patch"
_msg="Applying clear linux patches" && _tkg_patcher
fi
tkgpatch="$srcdir/0003-glitched-base.patch"
_msg="Applying glitched base patch" && _tkg_patcher
@ -616,13 +609,6 @@ _tkg_srcprep() {
fi
if [ "$_distro" = "Void" ] && [[ "$_sub" = rc* ]]; then
cd ${wrksrc}/linux-${_rc_kern_ver}
elif [ "$_distro" = "Void" ] && [[ "$_sub" != rc* ]]; then
cd ${wrksrc}/linux-${_kern_ver}
fi
if [ -z "${_configfile}" ]; then
msg2 "Using archlinux's default config file for kernel ${_basekernel}"
cat "${srcdir}"/config.x86_64 > ./.config
@ -697,12 +683,6 @@ _tkg_srcprep() {
_enable LTO_NONE
fi
fi
# Void uses LibreSSL
if [ "$_distro" = "Void" ]; then
_disable "MODULE_SIG_SHA512"
_enable "MODULE_SIG_SHA1"
scripts/config --set-str "MODULE_SIG_HASH" "sha1"
fi
# Prevent Debian and Ubuntu to sign stuff because it breaks stuff
if [[ "$_distro" = "Debian" || "$_distro" = "Ubuntu" ]]; then
@ -731,58 +711,57 @@ _tkg_srcprep() {
fi
# cpu opt
if [ -n "$opt_ver" ]; then
_cpu_marchs=("native_amd" "native_intel" "generic_cpu" "generic_cpu2" "generic_cpu3" "generic_cpu4")
_cpu_marchs+=("k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver")
_cpu_marchs+=("steamroller" "excavator" "zen" "zen2" "zen3" "mpsc" "atom" "core2" "nehalem" "westmere")
_cpu_marchs+=("bonnell" "silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake")
_cpu_marchs+=("skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake")
_cpu_marchs+=("cooperlake" "tigerlake" "sapphirerapids" "rocketlake" "alderlake")
_cpu_marchs=("native_amd" "native_intel" "generic_cpu" "generic_cpu2" "generic_cpu3" "generic_cpu4")
_cpu_marchs+=("k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver")
_cpu_marchs+=("steamroller" "excavator" "zen" "zen2" "zen3" "mpsc" "atom" "core2" "nehalem" "westmere")
_cpu_marchs+=("bonnell" "silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake")
_cpu_marchs+=("skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake")
_cpu_marchs+=("cooperlake" "tigerlake" "sapphirerapids" "rocketlake" "alderlake")
typeset -A _generic_march_map
_generic_march_map=(
["generic"]="generic_cpu"
["generic_v2"]="generic_cpu2"
["generic_v3"]="generic_cpu3"
["generic_v4"]="generic_cpu4"
)
if [ -n "$_processor_opt" ]; then
# Replace customization.cfg convention with .config convention for generic
if [[ "${!_generic_march_map[@]}" =~ "$_processor_opt" ]]; then
_processor_opt="${_generic_march_map[$_processor_opt]}"
fi
if ! [[ "${_cpu_marchs[@]}" =~ "$_processor_opt" ]]; then
warning "the setup _processor_opt=\"${_processor_opt}\" not recognized. Prompting..."
_processor_opt=""
fi
typeset -A _generic_march_map
_generic_march_map=(
["generic"]="generic_cpu"
["generic_v2"]="generic_cpu2"
["generic_v3"]="generic_cpu3"
["generic_v4"]="generic_cpu4"
)
if [ -n "$_processor_opt" ]; then
# Replace customization.cfg convention with .config convention for generic
if [[ "${!_generic_march_map[@]}" =~ "$_processor_opt" ]]; then
_processor_opt="${_generic_march_map[$_processor_opt]}"
fi
if [ -z "$_processor_opt" ]; then
msg2 "Please select the desired CPU micro-architecture"
_default_index="2"
_prompt_from_array "${_cpu_marchs[@]}"
_processor_opt="${_selected_value}"
if ! [[ "${_cpu_marchs[@]}" =~ "$_processor_opt" ]]; then
warning "the setup _processor_opt=\"${_processor_opt}\" not recognized. Prompting..."
_processor_opt=""
fi
for _march in "${_cpu_marchs[@]}"
do
_march_upper=`echo "$_march" | tr '[a-z]' '[A-Z]'`
if [ "$_processor_opt" = "$_march" ]; then
if [[ "$_march" = "generic"* ]]; then
_enable "${_march_upper}"
else
_enable "M${_march_upper}"
fi
else
if [[ "$_march" = "generic"* ]]; then
_disable "${_march_upper}"
else
_disable "M${_march_upper}"
fi
fi
done
fi
if [ -z "$_processor_opt" ]; then
msg2 "Please select the desired CPU micro-architecture"
_default_index="2"
_prompt_from_array "${_cpu_marchs[@]}"
_processor_opt="${_selected_value}"
fi
for _march in "${_cpu_marchs[@]}"
do
_march_upper=`echo "$_march" | tr '[a-z]' '[A-Z]'`
if [ "$_processor_opt" = "$_march" ]; then
if [[ "$_march" = "generic"* ]]; then
_enable "${_march_upper}"
else
_enable "M${_march_upper}"
fi
else
if [[ "$_march" = "generic"* ]]; then
_disable "${_march_upper}"
else
_disable "M${_march_upper}"
fi
fi
done
# Disable some debugging
if [ "${_debugdisable}" = "true" ]; then
_disable "SLUB_DEBUG" "PM_DEBUG" "PM_ADVANCED_DEBUG" "PM_SLEEP_DEBUG" "ACPI_DEBUG" "SCHED_DEBUG" "LATENCYTOP" "DEBUG_PREEMPT"
@ -1597,6 +1576,7 @@ exit_cleanup() {
msg2 "compilation time : \n$_runtime"
fi
}
# Void has its own clean function, this breaks it so ignore it
if [ "$_distro" != "Void" ]; then
trap exit_cleanup EXIT
fi

View File

@ -1,8 +1,8 @@
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 2fba82431efb..654a29d94696 100644
index f5a27f067db9..90c934ec13cc 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -5027,6 +5027,12 @@
@@ -5085,6 +5085,12 @@
sa1100ir [NET]
See drivers/net/irda/sa1100_ir.c.
@ -16,10 +16,10 @@ index 2fba82431efb..654a29d94696 100644
schedstats= [KNL,X86] Enable or disable scheduled statistics.
diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index 0e486f41185e..8f21f38e0b6b 100644
index d359bcfadd39..ba31800d7292 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -1542,3 +1542,13 @@ is 10 seconds.
@@ -1553,3 +1553,13 @@ is 10 seconds.
The softlockup threshold is (``2 * watchdog_thresh``). Setting this
tunable to zero will disable lockup detection altogether.
@ -150,7 +150,7 @@ index 000000000000..05c84eec0f31
+priority boost from unblocking while background threads that do most of the
+processing receive the priority penalty for using their entire timeslice.
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 13eda8de2998..55e2ada01231 100644
index d654ce7150fd..afe93f6f6a66 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -480,7 +480,7 @@ static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns,
@ -176,10 +176,10 @@ index 8874f681b056..59eb72bf7d5f 100644
[RLIMIT_RTTIME] = { RLIM_INFINITY, RLIM_INFINITY }, \
}
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 78c351e35fec..c6746f5ec3f5 100644
index 75ba8aa60248..3de388cb6923 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -748,8 +748,14 @@ struct task_struct {
@@ -753,8 +753,14 @@ struct task_struct {
unsigned int ptrace;
#ifdef CONFIG_SMP
@ -195,7 +195,7 @@ index 78c351e35fec..c6746f5ec3f5 100644
unsigned int wakee_flips;
unsigned long wakee_flip_decay_ts;
struct task_struct *last_wakee;
@@ -763,6 +769,7 @@ struct task_struct {
@@ -768,6 +774,7 @@ struct task_struct {
*/
int recent_used_cpu;
int wake_cpu;
@ -203,7 +203,7 @@ index 78c351e35fec..c6746f5ec3f5 100644
#endif
int on_rq;
@@ -771,6 +778,20 @@ struct task_struct {
@@ -776,6 +783,20 @@ struct task_struct {
int normal_prio;
unsigned int rt_priority;
@ -224,7 +224,7 @@ index 78c351e35fec..c6746f5ec3f5 100644
struct sched_entity se;
struct sched_rt_entity rt;
struct sched_dl_entity dl;
@@ -781,6 +802,7 @@ struct task_struct {
@@ -786,6 +807,7 @@ struct task_struct {
unsigned long core_cookie;
unsigned int core_occupation;
#endif
@ -232,7 +232,7 @@ index 78c351e35fec..c6746f5ec3f5 100644
#ifdef CONFIG_CGROUP_SCHED
struct task_group *sched_task_group;
@@ -1501,6 +1523,15 @@ struct task_struct {
@@ -1509,6 +1531,15 @@ struct task_struct {
*/
};
@ -338,7 +338,7 @@ index e5af028c08b4..0a7565d0d3cf 100644
}
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
index c07bfa2d80f2..bc4b03d83172 100644
index 8054641c0a7b..284687d47059 100644
--- a/include/linux/sched/topology.h
+++ b/include/linux/sched/topology.h
@@ -232,7 +232,8 @@ static inline bool cpus_share_cache(int this_cpu, int that_cpu)
@ -352,12 +352,20 @@ index c07bfa2d80f2..bc4b03d83172 100644
#else
static inline void rebuild_sched_domains_energy(void)
diff --git a/init/Kconfig b/init/Kconfig
index 4b7bac10c72d..f4630d8cde12 100644
index e9119bf54b1f..2213c306065e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -814,9 +814,39 @@ config GENERIC_SCHED_CLOCK
@@ -817,6 +817,7 @@ menu "Scheduler features"
config UCLAMP_TASK
bool "Enable utilization clamping for RT/FAIR tasks"
depends on CPU_FREQ_GOV_SCHEDUTIL
+ depends on !SCHED_ALT
help
This feature enables the scheduler to track the clamped utilization
of each CPU based on RUNNABLE tasks scheduled on that CPU.
@@ -863,6 +864,35 @@ config UCLAMP_BUCKETS_COUNT
menu "Scheduler features"
If in doubt, use the default value.
+menuconfig SCHED_ALT
+ bool "Alternative CPU Schedulers"
@ -388,13 +396,9 @@ index 4b7bac10c72d..f4630d8cde12 100644
+
+endif
+
config UCLAMP_TASK
bool "Enable utilization clamping for RT/FAIR tasks"
depends on CPU_FREQ_GOV_SCHEDUTIL
+ depends on !SCHED_ALT
help
This feature enables the scheduler to track the clamped utilization
of each CPU based on RUNNABLE tasks scheduled on that CPU.
endmenu
#
@@ -907,6 +937,7 @@ config NUMA_BALANCING
depends on ARCH_SUPPORTS_NUMA_BALANCING
depends on !ARCH_WANT_NUMA_VARIABLE_LOCALITY
@ -428,7 +432,7 @@ index 4b7bac10c72d..f4630d8cde12 100644
select CGROUP_SCHED
select FAIR_GROUP_SCHED
diff --git a/init/init_task.c b/init/init_task.c
index 2d024066e27b..49f706df0904 100644
index 73cc8f03511a..2d0bad762895 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -75,9 +75,15 @@ struct task_struct init_task
@ -487,10 +491,10 @@ index ce77f0265660..3cccf8caa1be 100644
This option permits Core Scheduling, a means of coordinated task
selection across SMT siblings. When enabled -- see
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index d0e163a02099..b5276a7a5d82 100644
index 5de18448016c..1eb323bb554f 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -682,7 +682,7 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
@@ -704,7 +704,7 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
return ret;
}
@ -499,7 +503,7 @@ index d0e163a02099..b5276a7a5d82 100644
/*
* Helper routine for generate_sched_domains().
* Do cpusets a, b have overlapping effective cpus_allowed masks?
@@ -1078,7 +1078,7 @@ static void rebuild_sched_domains_locked(void)
@@ -1100,7 +1100,7 @@ static void rebuild_sched_domains_locked(void)
/* Have scheduler rebuild the domains */
partition_and_rebuild_sched_domains(ndoms, doms, attr);
}
@ -509,10 +513,10 @@ index d0e163a02099..b5276a7a5d82 100644
{
}
diff --git a/kernel/delayacct.c b/kernel/delayacct.c
index 51530d5b15a8..e542d71bb94b 100644
index c5e8cea9e05f..8e90b2a3667a 100644
--- a/kernel/delayacct.c
+++ b/kernel/delayacct.c
@@ -139,7 +139,7 @@ int delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk)
@@ -130,7 +130,7 @@ int delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk)
*/
t1 = tsk->sched_info.pcount;
t2 = tsk->sched_info.run_delay;
@ -522,7 +526,7 @@ index 51530d5b15a8..e542d71bb94b 100644
d->cpu_count += t1;
diff --git a/kernel/exit.c b/kernel/exit.c
index f702a6a63686..be923678e3db 100644
index b00a25bb4ab9..f0e1d51aa838 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -122,7 +122,7 @@ static void __exit_signal(struct task_struct *tsk)
@ -544,7 +548,7 @@ index f702a6a63686..be923678e3db 100644
__unhash_process(tsk, group_dead);
write_sequnlock(&sig->stats_lock);
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index 1f25a4d7de27..449b2cc392a6 100644
index 8555c4efe97c..a2b3bd3fd85c 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -298,21 +298,25 @@ static __always_inline void
@ -610,10 +614,10 @@ index 1f25a4d7de27..449b2cc392a6 100644
static inline bool rt_mutex_steal(struct rt_mutex_waiter *waiter,
diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile
index c7421f2d05e1..9b32442ff2ca 100644
index c83b37af155b..c88e9aab0cb3 100644
--- a/kernel/sched/Makefile
+++ b/kernel/sched/Makefile
@@ -26,14 +26,21 @@ ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
@@ -25,14 +25,21 @@ ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
CFLAGS_core.o := $(PROFILING) -fno-omit-frame-pointer
endif
@ -643,10 +647,10 @@ index c7421f2d05e1..9b32442ff2ca 100644
obj-$(CONFIG_CPU_FREQ_GOV_SCHEDUTIL) += cpufreq_schedutil.o
diff --git a/kernel/sched/alt_core.c b/kernel/sched/alt_core.c
new file mode 100644
index 000000000000..114bd1fd88eb
index 000000000000..c52650a6e72e
--- /dev/null
+++ b/kernel/sched/alt_core.c
@@ -0,0 +1,7682 @@
@@ -0,0 +1,7680 @@
+/*
+ * kernel/sched/alt_core.c
+ *
@ -2090,14 +2094,14 @@ index 000000000000..114bd1fd88eb
+{
+ struct task_struct *p = current;
+
+ if (0 == p->migration_disabled)
+ return;
+
+ if (p->migration_disabled > 1) {
+ p->migration_disabled--;
+ return;
+ }
+
+ if (WARN_ON_ONCE(!p->migration_disabled))
+ return;
+
+ /*
+ * Ensure stop_task runs either before or after this, and that
+ * __set_cpus_allowed_ptr(SCA_MIGRATE_ENABLE) doesn't schedule().
@ -3626,6 +3630,9 @@ index 000000000000..114bd1fd88eb
+ if (unlikely(sched_info_on()))
+ memset(&p->sched_info, 0, sizeof(p->sched_info));
+#endif
+#if defined(CONFIG_SMP)
+ p->on_cpu = 0;
+#endif
+ init_task_preempt_count(p);
+
+ return 0;
@ -3677,7 +3684,7 @@ index 000000000000..114bd1fd88eb
+void sched_post_fork(struct task_struct *p)
+{
+#ifdef CONFIG_UCLAMP_TASK
+ uclamp_post_fork(p);
+ uclamp_post_fork(p);
+#endif
+}
+
@ -6859,9 +6866,7 @@ index 000000000000..114bd1fd88eb
+
+ if (spin_needbreak(lock) || resched) {
+ spin_unlock(lock);
+ if (resched)
+ preempt_schedule_common();
+ else
+ if (!_cond_resched())
+ cpu_relax();
+ ret = 1;
+ spin_lock(lock);
@ -6879,9 +6884,7 @@ index 000000000000..114bd1fd88eb
+
+ if (rwlock_needbreak(lock) || resched) {
+ read_unlock(lock);
+ if (resched)
+ preempt_schedule_common();
+ else
+ if (!_cond_resched())
+ cpu_relax();
+ ret = 1;
+ read_lock(lock);
@ -6899,9 +6902,7 @@ index 000000000000..114bd1fd88eb
+
+ if (rwlock_needbreak(lock) || resched) {
+ write_unlock(lock);
+ if (resched)
+ preempt_schedule_common();
+ else
+ if (!_cond_resched())
+ cpu_relax();
+ ret = 1;
+ write_lock(lock);
@ -7146,7 +7147,7 @@ index 000000000000..114bd1fd88eb
+ rcu_read_unlock();
+ pr_cont(" stack:%5lu pid:%5d ppid:%6d flags:0x%08lx\n",
+ free, task_pid_nr(p), ppid,
+ (unsigned long)task_thread_info(p)->flags);
+ read_task_thread_flags(p));
+
+ print_worker_info(KERN_INFO, p);
+ print_stop_info(KERN_INFO, p);
@ -7233,14 +7234,6 @@ index 000000000000..114bd1fd88eb
+
+ __sched_fork(0, idle);
+
+ /*
+ * The idle task doesn't need the kthread struct to function, but it
+ * is dressed up as a per-CPU kthread and thus needs to play the part
+ * if we want to avoid special-casing it in code that deals with per-CPU
+ * kthreads.
+ */
+ set_kthread_struct(idle);
+
+ raw_spin_lock_irqsave(&idle->pi_lock, flags);
+ raw_spin_lock(&rq->lock);
+ update_rq_clock(rq);
@ -7273,6 +7266,7 @@ index 000000000000..114bd1fd88eb
+
+ rq->idle = idle;
+ rcu_assign_pointer(rq->curr, idle);
+ idle->on_rq = TASK_ON_RQ_QUEUED;
+ idle->on_cpu = 1;
+
+ raw_spin_unlock(&rq->lock);
@ -7895,6 +7889,14 @@ index 000000000000..114bd1fd88eb
+ enter_lazy_tlb(&init_mm, current);
+
+ /*
+ * The idle task doesn't need the kthread struct to function, but it
+ * is dressed up as a per-CPU kthread and thus needs to play the part
+ * if we want to avoid special-casing it in code that deals with per-CPU
+ * kthreads.
+ */
+ WARN_ON(!set_kthread_struct(current));
+
+ /*
+ * Make us the idle thread. Technically, schedule() should not be
+ * called from this thread, however somewhere below it might be,
+ * but because we are the idle thread, we just pick up running again
@ -8368,10 +8370,10 @@ index 000000000000..1212a031700e
+{}
diff --git a/kernel/sched/alt_sched.h b/kernel/sched/alt_sched.h
new file mode 100644
index 000000000000..e78324687f6e
index 000000000000..6ff979a299ab
--- /dev/null
+++ b/kernel/sched/alt_sched.h
@@ -0,0 +1,661 @@
@@ -0,0 +1,662 @@
+#ifndef ALT_SCHED_H
+#define ALT_SCHED_H
+
@ -8405,6 +8407,7 @@ index 000000000000..e78324687f6e
+#include <linux/livepatch.h>
+#include <linux/membarrier.h>
+#include <linux/proc_fs.h>
+#include <linux/profile.h>
+#include <linux/psi.h>
+#include <linux/slab.h>
+#include <linux/stop_machine.h>
@ -9151,7 +9154,7 @@ index 000000000000..be3ee4a553ca
+
+static inline void update_rq_time_edge(struct rq *rq) {}
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index e7af18857371..3e38816b736e 100644
index 26778884d9ab..be6650b90671 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -167,9 +167,14 @@ static void sugov_get_util(struct sugov_cpu *sg_cpu)
@ -9199,7 +9202,7 @@ index e7af18857371..3e38816b736e 100644
static DECLARE_WORK(rebuild_sd_work, rebuild_sd_workfn);
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index 9392aea1804e..c1ead972e498 100644
index b7ec42732b28..a855594a540f 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -123,7 +123,7 @@ void account_user_time(struct task_struct *p, u64 cputime)
@ -9248,7 +9251,7 @@ index 9392aea1804e..c1ead972e498 100644
if (task_cputime(p, &cputime.utime, &cputime.stime))
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 7dcbaa31c5d9..331644375fd7 100644
index aa29211de1bf..d48216c27441 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -8,6 +8,7 @@
@ -9313,7 +9316,7 @@ index 7dcbaa31c5d9..331644375fd7 100644
#ifdef CONFIG_SMP
static cpumask_var_t sd_sysctl_cpus;
@@ -1074,6 +1083,7 @@ void proc_sched_set_task(struct task_struct *p)
@@ -1078,6 +1087,7 @@ void proc_sched_set_task(struct task_struct *p)
memset(&p->stats, 0, sizeof(p->stats));
#endif
}
@ -9495,7 +9498,7 @@ index a554e3bbab2b..3e56f5e6ff5c 100644
* thermal:
*
diff --git a/kernel/sched/pelt.h b/kernel/sched/pelt.h
index e06071bf3472..adf567df34d4 100644
index c336f5f481bc..5865f14714a9 100644
--- a/kernel/sched/pelt.h
+++ b/kernel/sched/pelt.h
@@ -1,13 +1,15 @@
@ -9515,15 +9518,15 @@ index e06071bf3472..adf567df34d4 100644
int update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity);
static inline u64 thermal_load_avg(struct rq *rq)
@@ -42,6 +44,7 @@ static inline u32 get_pelt_divider(struct sched_avg *avg)
return LOAD_AVG_MAX - 1024 + avg->period_contrib;
@@ -44,6 +46,7 @@ static inline u32 get_pelt_divider(struct sched_avg *avg)
return PELT_MIN_DIVIDER + avg->period_contrib;
}
+#ifndef CONFIG_SCHED_ALT
static inline void cfs_se_util_change(struct sched_avg *avg)
{
unsigned int enqueued;
@@ -153,9 +156,11 @@ static inline u64 cfs_rq_clock_pelt(struct cfs_rq *cfs_rq)
@@ -155,9 +158,11 @@ static inline u64 cfs_rq_clock_pelt(struct cfs_rq *cfs_rq)
return rq_clock_pelt(rq_of(cfs_rq));
}
#endif
@ -9535,7 +9538,7 @@ index e06071bf3472..adf567df34d4 100644
static inline int
update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq)
{
@@ -173,6 +178,7 @@ update_dl_rq_load_avg(u64 now, struct rq *rq, int running)
@@ -175,6 +180,7 @@ update_dl_rq_load_avg(u64 now, struct rq *rq, int running)
{
return 0;
}
@ -9544,7 +9547,7 @@ index e06071bf3472..adf567df34d4 100644
static inline int
update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity)
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 0e66749486e7..e60656f10c31 100644
index de53be905739..2644fb60510f 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2,6 +2,10 @@
@ -9558,7 +9561,7 @@ index 0e66749486e7..e60656f10c31 100644
#include <linux/sched.h>
#include <linux/sched/autogroup.h>
@@ -3054,3 +3058,8 @@ extern int sched_dynamic_mode(const char *str);
@@ -3118,3 +3122,8 @@ extern int sched_dynamic_mode(const char *str);
extern void sched_dynamic_update(int mode);
#endif
@ -9571,22 +9574,6 @@ diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c
index 07dde2928c79..6a6edc730dce 100644
--- a/kernel/sched/stats.c
+++ b/kernel/sched/stats.c
@@ -4,6 +4,7 @@
*/
#include "sched.h"
+#ifndef CONFIG_SCHED_ALT
void __update_stats_wait_start(struct rq *rq, struct task_struct *p,
struct sched_statistics *stats)
{
@@ -90,6 +90,7 @@
}
}
+#endif
/*
* Current schedstat API version.
*
@@ -126,8 +126,10 @@ static int show_schedstat(struct seq_file *seq, void *v)
} else {
struct rq *rq;
@ -9615,7 +9602,7 @@ index 07dde2928c79..6a6edc730dce 100644
}
return 0;
diff --git a/kernel/sched/stats.h b/kernel/sched/stats.h
index cfb0893a83d4..4fb593535447 100644
index 3a3c826dd83a..39df2b235944 100644
--- a/kernel/sched/stats.h
+++ b/kernel/sched/stats.h
@@ -94,6 +94,7 @@ struct sched_entity_stats {
@ -9690,21 +9677,21 @@ index d201a7052a29..163cec668095 100644
+#endif /* CONFIG_NUMA */
+#endif
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 083be6af29d7..09fc6281d488 100644
index 5ae443b2882e..7bb4e033cae6 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -122,6 +122,10 @@ static unsigned long long_max = LONG_MAX;
#endif
#endif /* CONFIG_SYSCTL */
@@ -94,6 +94,10 @@
#if defined(CONFIG_SYSCTL)
+#ifdef CONFIG_SCHED_ALT
+static int __maybe_unused zero = 0;
+extern int sched_yield_type;
+#endif
#if defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_SYSCTL)
static int bpf_stats_handler(struct ctl_table *table, int write,
@@ -1771,6 +1775,24 @@ int proc_do_static_key(struct ctl_table *table, int write,
+
#ifdef CONFIG_USER_NS
extern int unprivileged_userns_clone;
#endif
@@ -1652,6 +1656,24 @@ int proc_do_static_key(struct ctl_table *table, int write,
}
static struct ctl_table kern_table[] = {
@ -9729,7 +9716,7 @@ index 083be6af29d7..09fc6281d488 100644
{
.procname = "sched_child_runs_first",
.data = &sysctl_sched_child_runs_first,
@@ -1901,6 +1923,7 @@ static struct ctl_table kern_table[] = {
@@ -1782,6 +1804,7 @@ static struct ctl_table kern_table[] = {
.extra2 = SYSCTL_ONE,
},
#endif
@ -9737,7 +9724,7 @@ index 083be6af29d7..09fc6281d488 100644
#ifdef CONFIG_PROVE_LOCKING
{
.procname = "prove_locking",
@@ -2477,6 +2500,17 @@ static struct ctl_table kern_table[] = {
@@ -2167,6 +2190,17 @@ static struct ctl_table kern_table[] = {
.proc_handler = proc_dointvec,
},
#endif
@ -9831,10 +9818,10 @@ index 96b4e7810426..83457e8bb5d2 100644
return false;
}
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index afd937a46496..7fac2e43d668 100644
index abcadbe933bb..d4c778b0ab0e 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -1142,10 +1142,15 @@ static int trace_wakeup_test_thread(void *data)
@@ -1140,10 +1140,15 @@ static int trace_wakeup_test_thread(void *data)
{
/* Make this a -deadline thread */
static const struct sched_attr attr = {

View File

@ -60,7 +60,7 @@ _makenconfig=
pkgbase=linux-xanmod-edge
_major=5.16
pkgver=${_major}.12
pkgver=${_major}.16
_branch=5.x
xanmod=1
pkgrel=${xanmod}
@ -97,7 +97,7 @@ done
sha256sums=('027d7e8988bb69ac12ee92406c3be1fe13f990b1ca2249e226225cd1573308bb'
'SKIP'
'd6d162990832239a4ed28452e761a9c8e1c79b422551ecada1dc311b8d9c89fa'
'4725cdfa4f3375e4a07e4d6b323e022b12a6a9d1a09ed44c1939d67ca8062558'
'1ac18cad2578df4a70f9346f7c6fccbb62f042a0ee0594817fdef9f2704904ee')
export KBUILD_BUILD_HOST=${KBUILD_BUILD_HOST:-archlinux}

View File

@ -63,7 +63,7 @@ fi
pkgbase=linux-xanmod-lts
_major=5.10
pkgver=${_major}.103
pkgver=${_major}.104
_branch=5.x
xanmod=1
pkgrel=${xanmod}
@ -99,7 +99,7 @@ done
sha256sums=('dcdf99e43e98330d925016985bfbc7b83c66d367b714b2de0cbbfcbf83d8ca43'
'SKIP'
'b6fa53fd9b28f4514799717539f8c5dd66f7a1d2d1daa9dd1bb17dd7430385ca'
'a4c0dc91ac4532ab9f87835d6e85acb41e01fc27d91414a8609855f46c655ab4'
'1ac18cad2578df4a70f9346f7c6fccbb62f042a0ee0594817fdef9f2704904ee')
export KBUILD_BUILD_HOST=${KBUILD_BUILD_HOST:-archlinux}