Yield type and aggressive ondemand selectors fixes

This commit is contained in:
Tk-Glitch 2020-10-29 11:36:26 +01:00
parent f7618cf272
commit 681545b289

View File

@ -376,18 +376,19 @@ _tkg_srcprep() {
elif [ "${_cpusched}" = "upds" ] || [ "${_cpusched}" = "pds" ]; then
# PDS-mq
msg2 "Applying PDS base patch"
if [ "${_cpusched}" = "upds" ] && [ "$_basever" != "59" ]; then
if [ "${_cpusched}" = "upds" ] || ( [ "$_basever" = "54" ] || [ "$_basever" = "57" ] && [ "${_cpusched}" = "pds" ] ); then
tkgpatch="$srcdir/0005-v${_basekernel}_undead-pds099o.patch" && _tkg_patcher
elif [ "$_basever" != "54" ]; then
else
tkgpatch="$srcdir/0009-prjc_v${_basekernel}-r${rev}.patch" && _tkg_patcher
fi
# ondemand patches don't exist for 5.4
# 5.8 upds naming quirk
if [ "$_basever" = "58" ] && [ "${_cpusched}" = "upds" ];then
# is it dead or alive
doa="-undead"
fi
if [ "${_aggressive_ondemand}" = "true" ] && [ "$_basever" != "54" ] && [ "${_cpusched}" = "upds" ]; then
if [ "${_aggressive_ondemand}" = "true" ]; then
msg2 "Applying PDS agressive ondemand governor patch"
tkgpatch="$srcdir/0005${doa}-glitched-ondemand-pds.patch" && _tkg_patcher
fi
@ -582,36 +583,24 @@ _tkg_srcprep() {
read -rp "`echo $'\n > 0. Recommended option for gaming on PDS - "tkg" default\n 1. Default, but can lead to stability issues on some platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0;
fi
fi
if [ "$_basever" = "54" ] || [ "$_basever" = "57" ] && [ "$_cpusched" != "bmq" ]; then
_sched=${_cpusched}
if [ "${_cpusched}" = "upds" ] || ( [ "$_basever" = "54" ] || [ "$_basever" = "57" ] && [ "${_cpusched}" = "pds" ] ); then
_sched="pds"
elif [ "${_cpusched}" = "MuQSS" ] || [ "$_basever" != "54" ] && [ "$_cpusched" != "bmq" ] && [ "$_cpusched" != "pds" ]; then
_sched="${_cpusched}"
else
_sched="alt_core"
fi
if [ "$CONDITION0" = "0" ]; then
if [ "${_cpusched}" = "bmq" ] || [ "${_cpusched}" = "pds" ] && [ "$_basever" != "54" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/${_sched}.c
else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c
fi
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/${_sched}.c
elif [ "$CONDITION0" = "1" ]; then
msg2 "Using default CPU sched yield type (1)"
elif [ "$CONDITION0" = "2" ]; then
if [ "${_cpusched}" = "bmq" ] || [ "${_cpusched}" = "pds" ] && [ "$_basever" != "54" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/${_sched}.c
elif [ "${_cpusched}" = "upds" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/pds.c
else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/"${_cpusched}".c
fi
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/${_sched}.c
else
if [ "${_cpusched}" = "MuQSS" ]; then
msg2 "Using default CPU sched yield type (1)"
elif [ "${_cpusched}" = "bmq" ] || [ "${_cpusched}" = "pds" ] && [ "$_basever" != "54" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/${_sched}.c
elif [ "${_cpusched}" = "upds" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/pds.c
else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/${_sched}.c
fi
fi
fi