linux58-tkg: replace our PDS implementation with Project C's

This commit is contained in:
Tk-Glitch
2020-09-06 19:44:52 +02:00
parent 994fcbee93
commit a59c00ab6f
6 changed files with 14 additions and 8647 deletions

View File

@@ -33,7 +33,7 @@ _tkg_initscript() {
# CPU SCHED selector
if [ -z "$_cpusched" ] && [ ! -e "$_where"/cpuschedset ]; then
plain "What CPU sched variant do you want to build/install?"
read -rp "`echo $' > 1.PDS\n 2.Project C / BMQ\n 3.CFS\nchoice[1-3?]: '`" CONDITION;
read -rp "`echo $' > 1.Project C / PDS\n 2.Project C / BMQ\n 3.CFS\nchoice[1-3?]: '`" CONDITION;
if [ "$CONDITION" = "2" ]; then
echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
elif [ "$CONDITION" = "3" ]; then
@@ -178,11 +178,11 @@ _tkg_srcprep() {
elif [ "${_cpusched}" = "pds" ]; then
# PDS-mq
msg2 "Applying PDS base patch"
patch -Np1 -i "$srcdir"/0005-v5.8_undead-pds099o.patch
patch -Np1 -i "$srcdir"/0009-prjc_v5.8-r2.patch
if [ "${_aggressive_ondemand}" = "true" ]; then
msg2 "Applying PDS agressive ondemand governor patch"
patch -Np1 -i "$srcdir"/0005-glitched-ondemand-pds.patch
patch -Np1 -i "$srcdir"/0009-glitched-ondemand-bmq.patch
fi
msg2 "Applying Glitched PDS patch"
@@ -295,11 +295,14 @@ _tkg_srcprep() {
echo "CONFIG_SCHED_MUQSS=y" >> ./.config
elif [ "${_cpusched}" = "pds" ]; then
# PDS default config
echo "CONFIG_SCHED_ALT=y" >> ./.config
echo "CONFIG_SCHED_PDS=y" >> ./.config
echo "# CONFIG_SCHED_BMQ is not set" >> ./.config
elif [ "${_cpusched}" = "bmq" ]; then
# BMQ default config
echo "CONFIG_SCHED_ALT=y" >> ./.config
echo "CONFIG_SCHED_BMQ=y" >> ./.config
echo "# CONFIG_SCHED_PDS is not set" >> ./.config
fi
if [ "${_cpusched}" = "MuQSS" ] || [ "${_cpusched}" = "pds" ] || [ "${_cpusched}" = "bmq" ]; then
@@ -329,7 +332,7 @@ _tkg_srcprep() {
fi
fi
if [ "$CONDITION0" = "0" ]; then
if [ "${_cpusched}" = "bmq" ]; then
if [ "${_cpusched}" = "bmq" ] || [ "${_cpusched}" = "pds" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c
else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c
@@ -337,7 +340,7 @@ _tkg_srcprep() {
elif [ "$CONDITION0" = "1" ]; then
msg2 "Using default CPU sched yield type (1)"
elif [ "$CONDITION0" = "2" ]; then
if [ "${_cpusched}" = "bmq" ]; then
if [ "${_cpusched}" = "bmq" ] || [ "${_cpusched}" = "pds" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/alt_core.c
else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/"${_cpusched}".c
@@ -345,10 +348,8 @@ _tkg_srcprep() {
else
if [ "${_cpusched}" = "MuQSS" ]; then
msg2 "Using default CPU sched yield type (1)"
elif [ "${_cpusched}" = "bmq" ]; then
elif [ "${_cpusched}" = "bmq" ] || [ "${_cpusched}" = "pds" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.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
fi
fi
@@ -388,13 +389,11 @@ _tkg_srcprep() {
if [ "$_rrvalue" != "default" ]; then
if [ "${_cpusched}" = "MuQSS" ]; then
sed -i -e "s/int rr_interval __read_mostly = 6;/int rr_interval __read_mostly = ${_rrvalue};/" ./kernel/sched/"${_cpusched}".c
elif [ "${_cpusched}" = "pds" ]; then
sed -i -e "s/#define SCHED_DEFAULT_RR (4)/#define SCHED_DEFAULT_RR (${_rrvalue})/" ./kernel/sched/"${_cpusched}".c
elif [ "${_cpusched}" = "bmq" ]; then
elif [ "${_cpusched}" = "bmq" ] || [ "${_cpusched}" = "pds" ]; then
sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (${_rrvalue} * 1000 * 1000);/" ./kernel/sched/alt_core.c
fi
else
if [ "${_cpusched}" = "bmq" ]; then
if [ "${_cpusched}" = "bmq" ] || [ "${_cpusched}" = "pds" ]; then
sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (2 * 1000 * 1000);/" ./kernel/sched/alt_core.c
fi
fi