sched-ext / scx

sched_ext schedulers and tools
https://bit.ly/scx_slack
GNU General Public License v2.0
844 stars 79 forks source link

scx_rustland: prevent starvation #345

Closed arighi closed 3 months ago

arighi commented 3 months ago

A set of changes that helps prevent potential starvation conditions.

This also seems to improve system responsiveness (~4-5% fps during the typical "gaming while building the kernel" benchmark) and it also helps to prevent potential audio cracking issues.

This patch has been produced thanks to the extensive iteration tests performed by SoulHarsh007 harsh.peshwani@outlook.com from the CachyOS community. Big kudos to him for all his valuable feedback.

arighi commented 3 months ago

I'm going to merge all these commits except the last one, since they provide clear benefits in terms of responsiveness and they help to prevent audio cracking.

About the stall issue reported by SoulHarsh007, I'd like to investigate more and better understand the nature of the problem, so I'm going to drop the last commit (the one that always kicks the CPUs without using __COMPAT_SCX_KICK_IDLE). Even if it seems to prevent the stall, I'm worried that we would just hide the real problem, hence I'm excluding it for now.

This issue is still tracked in #353, so we can merge and close this PR and I'll create a new PR once we have a proper fix.