Skip to content

Commit

Permalink
linux-cachyos-rc: Disable dynamic preemption
Browse files Browse the repository at this point in the history
By observing a few results, it is observed that dynamic preemption can somehow blur the results between the various
preemption models. One example is [1] where there seems to be a 5% difference in throughput between voluntary vs full
with dynamic preemption disabled but then the difference goes to a measly 0.6% when dynamic preemption is enabled.
I've also been able to reproduce this behaviour across various benchmarks, one of them shared in [2].

Due to that, let's disable dynamic preemption for all kernel configurations (or atleast the default). Note that
PREEMPT_DYNAMIC is kept enabled for fully preempted kernels, as it is observed that it doesn't seem to matter for those,
so having more options is the priority in this case.

[1] https://lore.kernel.org/all/579b7ea34ef6e2f7c955abdfc0929fe1af36faef.camel@gmx.de/
[2] #339

Signed-off-by: Eric Naim <dnaim@cachyos.org>
  • Loading branch information
1Naim committed Jan 7, 2025
1 parent fb875c7 commit 097507f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion linux-cachyos-rc/.SRCINFO
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pkgbase = linux-cachyos-rc
source = https://raw.githubusercontent.com/cachyos/kernel-patches/master/6.13/misc/dkms-clang.patch
source = https://raw.githubusercontent.com/cachyos/kernel-patches/master/6.13/sched/0001-bore-cachy.patch
b2sums = e82921a5852d76802004fa3764f60a916b5a2382d81ec593b63421bdfd09a2222c8afe91905abcbb1d9a4bbb270808cb247ca7f63f1db70abba39c7507133834
b2sums = 9f099de709e971acfb9463ac96810a0ddfbd669dd8af891c7301e9ae463130a0ece65ce0c6ec35af62fcb4ed921e15870ec9db29f74b7f9d9017ff268b43d2d5
b2sums = a25adc740f32d32708fc4d608656d62ce8cbfd4503c58c602927eb63d4ccdda09d49def4be718c220209c30cefebf33c3759e13c5fa4ccc862b15e416877c3e7
b2sums = 390c7b80608e9017f752b18660cc18ad1ec69f0aab41a2edfcfc26621dcccf5c7051c9d233d9bdf1df63d5f1589549ee0ba3a30e43148509d27dafa9102c19ab
b2sums = 4bb8bbbaea6669663e2b4d4879dba05d352fd3fb5b8d9b9889d0c3ffcb8c46a6d5f63a167c64470ea6ea17e1046c7d297c7139edc8da0df2ae7636d20e311619
b2sums = c7294a689f70b2a44b0c4e9f00c61dbd59dd7063ecbe18655c4e7f12e21ed7c5bb4f5169f5aa8623b1c59de7b2667facb024913ecb9f4c650dabce4e8a7e5452
Expand Down
4 changes: 2 additions & 2 deletions linux-cachyos-rc/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ prepare() {

case "$_preempt" in
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;;
lazy) scripts/config -d 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;;
none) scripts/config -d PREEMPT_DYNAMIC -e PREEMPT_NONE_BUILD -d PREEMPT -d PREEMPT_VOLUNTARY -d PREEMPT_LAZY -e PREEMPT_NONE;;
*) _die "The value '$_preempt' is invalid. Choose the correct one again.";;
Expand Down Expand Up @@ -832,7 +832,7 @@ for _p in "${pkgname[@]}"; do
done

b2sums=('e82921a5852d76802004fa3764f60a916b5a2382d81ec593b63421bdfd09a2222c8afe91905abcbb1d9a4bbb270808cb247ca7f63f1db70abba39c7507133834'
'9f099de709e971acfb9463ac96810a0ddfbd669dd8af891c7301e9ae463130a0ece65ce0c6ec35af62fcb4ed921e15870ec9db29f74b7f9d9017ff268b43d2d5'
'a25adc740f32d32708fc4d608656d62ce8cbfd4503c58c602927eb63d4ccdda09d49def4be718c220209c30cefebf33c3759e13c5fa4ccc862b15e416877c3e7'
'390c7b80608e9017f752b18660cc18ad1ec69f0aab41a2edfcfc26621dcccf5c7051c9d233d9bdf1df63d5f1589549ee0ba3a30e43148509d27dafa9102c19ab'
'4bb8bbbaea6669663e2b4d4879dba05d352fd3fb5b8d9b9889d0c3ffcb8c46a6d5f63a167c64470ea6ea17e1046c7d297c7139edc8da0df2ae7636d20e311619'
'c7294a689f70b2a44b0c4e9f00c61dbd59dd7063ecbe18655c4e7f12e21ed7c5bb4f5169f5aa8623b1c59de7b2667facb024913ecb9f4c650dabce4e8a7e5452'
Expand Down
2 changes: 1 addition & 1 deletion linux-cachyos-rc/config
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ CONFIG_PREEMPT=y
# CONFIG_PREEMPT_RT is not set
CONFIG_PREEMPT_COUNT=y
CONFIG_PREEMPTION=y
CONFIG_PREEMPT_DYNAMIC=y
# CONFIG_PREEMPT_DYNAMIC is not set
CONFIG_SCHED_CORE=y
CONFIG_SCHED_CLASS_EXT=y

Expand Down

0 comments on commit 097507f

Please sign in to comment.