Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: $_cpusched Options Cleanup #369

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 12 additions & 20 deletions linux-cachyos-rc/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ _cachy_config=${_cachy_config-y}
# ATTENTION - only one of the following values can be selected:
# 'bore' - select 'Burst-Oriented Response Enhancer'
# 'bmq' - select 'BMQ Scheduler'
# 'hardened' - select 'BORE Scheduler hardened' ## kernel with hardened config and hardening patches with the bore scheduler
# 'cachyos' - select 'CachyOS Default Scheduler (BORE)'
# 'pds' - select 'PDS scheduler'
# 'eevdf' - select 'EEVDF Scheduler'
# 'rt' - select EEVDF, but includes a series of realtime patches
# 'rt-bore' - select Burst-Oriented Response Enhancer, but includes a series of realtime patches
_cpusched=${_cpusched-cachyos}
_cpusched=${_cpusched-bore}

### Tweak kernel options prior to a build via nconfig
_makenconfig=${_makenconfig-}
Expand Down Expand Up @@ -76,7 +73,7 @@ _HZ_ticks=${_HZ_ticks-1000}
### Full tickless can give higher performances in various cases but, depending on hardware, lower consistency.
_tickrate=${_tickrate-full}

## Choose between full(low-latency), lazy, voluntary or none
## Choose between rt(realtime), full(low-latency), lazy, voluntary or none
_preempt=${_preempt-full}

### Transparent Hugepages
Expand Down Expand Up @@ -224,8 +221,10 @@ if _is_lto_kernel; then
fi

# WARNING The ZFS module doesn't build with selected RT sched due to licensing issues.
if [[ "$_cpusched" = "rt" || "$_cpusched" = "rt-bore" ]]; then
if [ "$_preempt" = "rt" ]; then
unset _build_zfs
# Uncomment this when the patch exists
#source+=("${_patchsource}/misc/0001-rt.patch")
fi

# ZFS support
Expand Down Expand Up @@ -263,12 +262,10 @@ fi

## List of CachyOS schedulers
case "$_cpusched" in
cachyos|bore|rt-bore|hardened) # CachyOS Scheduler (BORE)
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;&
bmq) ## Project C Scheduler
bore) # CachyOS Scheduler (BORE)
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
bmq|pds) ## Project C Scheduler
source+=("${_patchsource}/sched/0001-prjc-cachy.patch");;
hardened) ## Hardened Patches
source+=("${_patchsource}/misc/0001-hardened.patch");;
esac

export KBUILD_BUILD_HOST=cachyos
Expand Down Expand Up @@ -329,11 +326,10 @@ prepare() {
[ -z "$_cpusched" ] && _die "The value is empty. Choose the correct one again."

case "$_cpusched" in
cachyos|bore|hardened) scripts/config -e SCHED_BORE;;
bore) scripts/config -e SCHED_BORE;;
bmq) scripts/config -e SCHED_ALT -e SCHED_BMQ;;
pds) scripts/config -e SCHED_ALT -e SCHED_PDS;;
eevdf) ;;
rt) scripts/config -d PREEMPT -e PREEMPT_RT;;
rt-bore) scripts/config -e SCHED_BORE -d PREEMPT -e PREEMPT_RT;;
*) _die "The value $_cpusched is invalid. Choose the correct one again.";;
esac

Expand Down Expand Up @@ -411,12 +407,8 @@ prepare() {
echo "Selecting '$_tickrate' tick type..."

### Select preempt type

# We should not set up the PREEMPT for RT kernels
if [[ "$_cpusched" != "rt" || "$_cpusched" != "rt-bore" ]]; then
[ -z "$_preempt" ] && _die "The value is empty. Choose the correct one again."

case "$_preempt" in
rt) scripts/config -e PREEMPT_DYNAMIC -e PREEMPT -e PREEMPT_RT;;
full) scripts/config -e PREEMPT_DYNAMIC -e PREEMPT -d PREEMPT_VOLUNTARY -d PREEMPT_LAZY -d PREEMPT_NONE;;
lazy) scripts/config -e PREEMPT_DYNAMIC -d PREEMPT -d PREEMPT_VOLUNTARY -e PREEMPT_LAZY -d PREEMPT_NONE;;
voluntary) scripts/config -d PREEMPT_DYNAMIC -e PREEMPT_VOLUNTARY_BUILD -d PREEMPT -e PREEMPT_VOLUNTARY -d PREEMPT_LAZY -d PREEMPT_NONE;;
Expand Down