Skip to content

Commit

Permalink
Set sched-ext as default CachyOS scheduler (#209)
Browse files Browse the repository at this point in the history
* Set sched-ext as default CachyOS scheduler

Signed-off-by: Piotr Gorski <[email protected]>

* Prevent to disabling debug with sched-ext - fix flag

Signed-off-by: Piotr Gorski <[email protected]>

---------

Signed-off-by: Piotr Gorski <[email protected]>
Co-authored-by: ptr1337 <[email protected]>
  • Loading branch information
sirlucjan and ptr1337 authored Jan 15, 2024
1 parent 1222f7b commit 23f482c
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 92 deletions.
19 changes: 8 additions & 11 deletions linux-bore/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ _cachy_config=${_cachy_config-y}
# 'sched-ext' - select 'sched-ext' Scheduler, based on EEVDF
_cpusched=${_cpusched-bore}


### Tweak kernel options prior to a build via nconfig
_makenconfig=${_makenconfig-}

Expand Down Expand Up @@ -193,7 +192,7 @@ if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_k
)
fi

if [ "$_cpusched" = "sched-ext" ]; then
if [[ "$_cpusched" = "sched-ext" || "$_cpusched" = "cachyos" ]]; then
depends+=(scx-scheds)
fi

Expand Down Expand Up @@ -223,10 +222,11 @@ if [ -n "$_build_nvidia" ]; then
"$_patchsource/misc/nvidia/nvidia-drm-hotplug-workqueue.patch")
fi

## ToDo: Adjust for new Scheduler Changes
## List of CachyOS schedulers
case "$_cpusched" in
cachyos) # CachyOS Scheduler (EEVDF + BORE)
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
cachyos|sched-ext) # CachyOS Scheduler (BORE + EEVDF)
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
bore) ## BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
rt) ## EEVDF with RT patches
Expand All @@ -239,9 +239,6 @@ case "$_cpusched" in
hardened) ## Hardened Patches with BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch"
"${_patchsource}/misc/0001-hardened.patch");;
sched-ext) ## Sched-ext with BORE
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
esac

## lrng patchset
Expand Down Expand Up @@ -300,11 +297,11 @@ prepare() {
[ -z "$_cpusched" ] && _die "The value is empty. Choose the correct one again."

case "$_cpusched" in
bore|hardened|cachyos) scripts/config -e SCHED_BORE;;
cachyos|sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
bore|hardened) scripts/config -e SCHED_BORE;;
eevdf) ;;
rt) scripts/config -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
rt-bore) scripts/config -e SCHED_BORE -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
*) _die "The value $_cpusched is invalid. Choose the correct one again.";;
esac

Expand Down Expand Up @@ -555,7 +552,7 @@ prepare() {
### Disable DEBUG
# Doesn't work with sched-ext
# More infos here: https://github.com/CachyOS/linux-cachyos/issues/187
if [[ "$_cpusched" != "sched-ext" && -n "$_disable_debug" ]]; then
if [[ "$_cpusched" != "sched-ext" || "$_cpusched" != "cachyos" ]] && [ -n "$_disable_debug" ]; then
scripts/config -d DEBUG_INFO \
-d DEBUG_INFO_BTF \
-d DEBUG_INFO_DWARF4 \
Expand Down
18 changes: 8 additions & 10 deletions linux-cachyos-bore/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_k
)
fi

if [ "$_cpusched" = "sched-ext" ]; then
if [[ "$_cpusched" = "sched-ext" || "$_cpusched" = "cachyos" ]]; then
depends+=(scx-scheds)
fi

Expand Down Expand Up @@ -223,10 +223,11 @@ if [ -n "$_build_nvidia" ]; then
"$_patchsource/misc/nvidia/nvidia-drm-hotplug-workqueue.patch")
fi

## ToDo: Adjust for new Scheduler Changes
## List of CachyOS schedulers
case "$_cpusched" in
cachyos) # CachyOS Scheduler (EEVDF + BORE)
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
cachyos|sched-ext) # CachyOS Scheduler (BORE + EEVDF)
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
bore) ## BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
rt) ## EEVDF with RT patches
Expand All @@ -239,9 +240,6 @@ case "$_cpusched" in
hardened) ## Hardened Patches with BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch"
"${_patchsource}/misc/0001-hardened.patch");;
sched-ext) ## Sched-ext with BORE
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
esac

## lrng patchset
Expand Down Expand Up @@ -300,11 +298,11 @@ prepare() {
[ -z "$_cpusched" ] && _die "The value is empty. Choose the correct one again."

case "$_cpusched" in
bore|hardened|cachyos) scripts/config -e SCHED_BORE;;
cachyos|sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
bore|hardened) scripts/config -e SCHED_BORE;;
eevdf) ;;
rt) scripts/config -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
rt-bore) scripts/config -e SCHED_BORE -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
*) _die "The value $_cpusched is invalid. Choose the correct one again.";;
esac

Expand Down Expand Up @@ -555,7 +553,7 @@ prepare() {
### Disable DEBUG
# Doesn't work with sched-ext
# More infos here: https://github.com/CachyOS/linux-cachyos/issues/187
if [[ "$_cpusched" != "sched-ext" && -n "$_disable_debug" ]]; then
if [[ "$_cpusched" != "sched-ext" || "$_cpusched" != "cachyos" ]] && [ -n "$_disable_debug" ]; then
scripts/config -d DEBUG_INFO \
-d DEBUG_INFO_BTF \
-d DEBUG_INFO_DWARF4 \
Expand Down
18 changes: 8 additions & 10 deletions linux-cachyos-eevdf/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_k
)
fi

if [ "$_cpusched" = "sched-ext" ]; then
if [[ "$_cpusched" = "sched-ext" || "$_cpusched" = "cachyos" ]]; then
depends+=(scx-scheds)
fi

Expand Down Expand Up @@ -222,10 +222,11 @@ if [ -n "$_build_nvidia" ]; then
"$_patchsource/misc/nvidia/nvidia-drm-hotplug-workqueue.patch")
fi

## ToDo: Adjust for new Scheduler Changes
## List of CachyOS schedulers
case "$_cpusched" in
cachyos) # CachyOS Scheduler (EEVDF + BORE)
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
cachyos|sched-ext) # CachyOS Scheduler (BORE + EEVDF)
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
bore) ## BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
rt) ## EEVDF with RT patches
Expand All @@ -238,9 +239,6 @@ case "$_cpusched" in
hardened) ## Hardened Patches with BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch"
"${_patchsource}/misc/0001-hardened.patch");;
sched-ext) ## Sched-ext with BORE
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
esac

## lrng patchset
Expand Down Expand Up @@ -299,11 +297,11 @@ prepare() {
[ -z "$_cpusched" ] && _die "The value is empty. Choose the correct one again."

case "$_cpusched" in
bore|hardened|cachyos) scripts/config -e SCHED_BORE;;
cachyos|sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
bore|hardened) scripts/config -e SCHED_BORE;;
eevdf) ;;
rt) scripts/config -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
rt-bore) scripts/config -e SCHED_BORE -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
*) _die "The value $_cpusched is invalid. Choose the correct one again.";;
esac

Expand Down Expand Up @@ -554,7 +552,7 @@ prepare() {
### Disable DEBUG
# Doesn't work with sched-ext
# More infos here: https://github.com/CachyOS/linux-cachyos/issues/187
if [[ "$_cpusched" != "sched-ext" && -n "$_disable_debug" ]]; then
if [[ "$_cpusched" != "sched-ext" || "$_cpusched" != "cachyos" ]] && [ -n "$_disable_debug" ]; then
scripts/config -d DEBUG_INFO \
-d DEBUG_INFO_BTF \
-d DEBUG_INFO_DWARF4 \
Expand Down
18 changes: 8 additions & 10 deletions linux-cachyos-rc/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_k
)
fi

if [ "$_cpusched" = "sched-ext" ]; then
if [[ "$_cpusched" = "sched-ext" || "$_cpusched" = "cachyos" ]]; then
depends+=(scx-scheds)
fi

Expand Down Expand Up @@ -222,10 +222,11 @@ if [ -n "$_build_nvidia" ]; then
"$_patchsource/misc/nvidia/nvidia-drm-hotplug-workqueue.patch")
fi

## ToDo: Adjust for new Scheduler Changes
## List of CachyOS schedulers
case "$_cpusched" in
cachyos) # CachyOS Scheduler (EEVDF + BORE)
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
cachyos|sched-ext) # CachyOS Scheduler (BORE + EEVDF)
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
bore) ## BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
rt) ## EEVDF with RT patches
Expand All @@ -238,9 +239,6 @@ case "$_cpusched" in
hardened) ## Hardened Patches with BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch"
"${_patchsource}/misc/0001-hardened.patch");;
sched-ext) ## Sched-ext with BORE
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
esac

## lrng patchset
Expand Down Expand Up @@ -299,11 +297,11 @@ prepare() {
[ -z "$_cpusched" ] && _die "The value is empty. Choose the correct one again."

case "$_cpusched" in
bore|hardened|cachyos) scripts/config -e SCHED_BORE;;
cachyos|sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
bore|hardened) scripts/config -e SCHED_BORE;;
eevdf) ;;
rt) scripts/config -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
rt-bore) scripts/config -e SCHED_BORE -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
*) _die "The value $_cpusched is invalid. Choose the correct one again.";;
esac

Expand Down Expand Up @@ -554,7 +552,7 @@ prepare() {
### Disable DEBUG
# Doesn't work with sched-ext
# More infos here: https://github.com/CachyOS/linux-cachyos/issues/187
if [[ "$_cpusched" != "sched-ext" && -n "$_disable_debug" ]]; then
if [[ "$_cpusched" != "sched-ext" || "$_cpusched" != "cachyos" ]] && [ -n "$_disable_debug" ]; then
scripts/config -d DEBUG_INFO \
-d DEBUG_INFO_BTF \
-d DEBUG_INFO_DWARF4 \
Expand Down
18 changes: 8 additions & 10 deletions linux-cachyos-rt-bore/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_k
)
fi

if [ "$_cpusched" = "sched-ext" ]; then
if [[ "$_cpusched" = "sched-ext" || "$_cpusched" = "cachyos" ]]; then
depends+=(scx-scheds)
fi

Expand Down Expand Up @@ -222,10 +222,11 @@ if [ -n "$_build_nvidia" ]; then
"$_patchsource/misc/nvidia/nvidia-drm-hotplug-workqueue.patch")
fi

## ToDo: Adjust for new Scheduler Changes
## List of CachyOS schedulers
case "$_cpusched" in
cachyos) # CachyOS Scheduler (EEVDF + BORE)
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
cachyos|sched-ext) # CachyOS Scheduler (BORE + EEVDF)
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
bore) ## BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
rt) ## EEVDF with RT patches
Expand All @@ -238,9 +239,6 @@ case "$_cpusched" in
hardened) ## Hardened Patches with BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch"
"${_patchsource}/misc/0001-hardened.patch");;
sched-ext) ## Sched-ext with BORE
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
esac

## lrng patchset
Expand Down Expand Up @@ -299,11 +297,11 @@ prepare() {
[ -z "$_cpusched" ] && _die "The value is empty. Choose the correct one again."

case "$_cpusched" in
bore|hardened|cachyos) scripts/config -e SCHED_BORE;;
cachyos|sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
bore|hardened) scripts/config -e SCHED_BORE;;
eevdf) ;;
rt) scripts/config -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
rt-bore) scripts/config -e SCHED_BORE -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
*) _die "The value $_cpusched is invalid. Choose the correct one again.";;
esac

Expand Down Expand Up @@ -554,7 +552,7 @@ prepare() {
### Disable DEBUG
# Doesn't work with sched-ext
# More infos here: https://github.com/CachyOS/linux-cachyos/issues/187
if [[ "$_cpusched" != "sched-ext" && -n "$_disable_debug" ]]; then
if [[ "$_cpusched" != "sched-ext" || "$_cpusched" != "cachyos" ]] && [ -n "$_disable_debug" ]; then
scripts/config -d DEBUG_INFO \
-d DEBUG_INFO_BTF \
-d DEBUG_INFO_DWARF4 \
Expand Down
18 changes: 8 additions & 10 deletions linux-cachyos-rt/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_k
)
fi

if [ "$_cpusched" = "sched-ext" ]; then
if [[ "$_cpusched" = "sched-ext" || "$_cpusched" = "cachyos" ]]; then
depends+=(scx-scheds)
fi

Expand Down Expand Up @@ -222,10 +222,11 @@ if [ -n "$_build_nvidia" ]; then
"$_patchsource/misc/nvidia/nvidia-drm-hotplug-workqueue.patch")
fi

## ToDo: Adjust for new Scheduler Changes
## List of CachyOS schedulers
case "$_cpusched" in
cachyos) # CachyOS Scheduler (EEVDF + BORE)
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
cachyos|sched-ext) # CachyOS Scheduler (BORE + EEVDF)
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
bore) ## BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;
rt) ## EEVDF with RT patches
Expand All @@ -238,9 +239,6 @@ case "$_cpusched" in
hardened) ## Hardened Patches with BORE Scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch"
"${_patchsource}/misc/0001-hardened.patch");;
sched-ext) ## Sched-ext with BORE
source+=("${_patchsource}/sched/0001-sched-ext.patch"
"${_patchsource}/sched/0001-bore-cachy.patch");;
esac

## lrng patchset
Expand Down Expand Up @@ -299,11 +297,11 @@ prepare() {
[ -z "$_cpusched" ] && _die "The value is empty. Choose the correct one again."

case "$_cpusched" in
bore|hardened|cachyos) scripts/config -e SCHED_BORE;;
cachyos|sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
bore|hardened) scripts/config -e SCHED_BORE;;
eevdf) ;;
rt) scripts/config -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
rt-bore) scripts/config -e SCHED_BORE -e PREEMPT_COUNT -e PREEMPTION -d PREEMPT_VOLUNTARY -d PREEMPT -d PREEMPT_NONE -e PREEMPT_RT -d PREEMPT_DYNAMIC -d PREEMPT_BUILD;;
sched-ext) scripts/config -e SCHED_BORE -e SCHED_CLASS_EXT;;
*) _die "The value $_cpusched is invalid. Choose the correct one again.";;
esac

Expand Down Expand Up @@ -554,7 +552,7 @@ prepare() {
### Disable DEBUG
# Doesn't work with sched-ext
# More infos here: https://github.com/CachyOS/linux-cachyos/issues/187
if [[ "$_cpusched" != "sched-ext" && -n "$_disable_debug" ]]; then
if [[ "$_cpusched" != "sched-ext" || "$_cpusched" != "cachyos" ]] && [ -n "$_disable_debug" ]; then
scripts/config -d DEBUG_INFO \
-d DEBUG_INFO_BTF \
-d DEBUG_INFO_DWARF4 \
Expand Down
Loading

0 comments on commit 23f482c

Please sign in to comment.