-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rusty: Dynamically scale slice according to system util
In user space in rusty, the tuner detects system utilization, and uses it to inform how we do load balancing, our greedy / direct cpumasks, etc. Something else we could be doing but currently aren't, is using system utilization to inform how we dispatch tasks. We currently have a static, unchanging slice length for the runtime of the program, but this is inefficient for all scenarios. Giving a task a long slice length does have advantages, such as decreasing the number of involuntary context switches, decreasing the overhead of preemption by doing it less frequently, possibly getting better cache locality due to a task running on a CPU for a longer amount of time, etc. On the other hand, long slices can be problematic as well. When a system is highly utilized, a CPU-hogging task running for too long can harm interactive tasks. When the system is under-utilized, those interactive tasks can likely find an idle, or under-utilized core to run on. When the system is over-utilized, however, they're likely to have to park in a runqueue. Thus, in order to better accommodate such scenarios, this patch implements a rudimentary slice scaling mechanism in scx_rusty. Rather than having one global, static slice length, we instead have a dynamic, global slice length that can be changed depending on system utilization. When over-utilized, we go with a longer slice length, and vice versa for when the system is under-utilized. With Terraria, this results in roughly a 50% improvement in mean FPS when playing on an AMD Ryzen 9 7950X, while running Spotify, and stress-ng -c $((4 * $(nproc))). Signed-off-by: David Vernet <[email protected]>
- Loading branch information
Showing
3 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters