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

BORE: Restore default base slice value of 2ms #305

Merged
merged 1 commit into from
Oct 2, 2024
Merged

Conversation

1Naim
Copy link
Member

@1Naim 1Naim commented Oct 2, 2024

Currently, we set the min_base_slice_ns value of BORE to 1000000 (1ms). This was previously added to circumvent some audio crackling and glitches
using 1000Hz kernel. However, a few benchmarks I did (see below) shows that throughput is worse with a base slice of 1ms compared to 2ms.
This behaviour is expected and it doesn't matter much when using BORE as a scheduler because we are not focused on throughput, but rather deskop responsiveness
and interactivity. What was unforeseen however, was the fact that responsiveness under heavy load was also hurt by lowering the base slice to 1ms.

@firelzrd, the developer of BORE, has also stated that a base slice of anything lower than 2ms will cause excessive scheduling, poor cache efficiency and
increased CPU overhead. It will also lower throughput (as mentioned earlier) which can also harm responsiveness.

Users can compare between these two base slice values by the following command for testing:

echo 2000000 | sudo tee /sys/kernel/debug/sched/min_base_slice_ns

image

@ptr1337
Copy link
Member

ptr1337 commented Oct 2, 2024

The problem was, that setting the default value together with 1000 Hz introduced audio stutters

@1Naim
Copy link
Member Author

1Naim commented Oct 2, 2024

The problem was, that setting the default value together with 1000 Hz introduced audio stutters

Ironically, I get more audio crackles with 1ms than 2ms. Also, the reportee who got the audio stutters was using an absurdly low minimum quant of 32. Setting the base slice to 1ms at runtime also didn't fix it for them which is weird to me.

absurdly low minimum quant of 32

To clarify this, there is nothing wrong with the minimum value in of itself. Problems arise when apps are patched to use the min quant or forcing the min quant for an app instead that makes use of this value and in turn causes crackles if the sound card/CPU isn't able to handle it.

@ptr1337 ptr1337 merged commit 36066a7 into master Oct 2, 2024
2 checks passed
@ptr1337 ptr1337 deleted the bore/restore-slice branch October 2, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants