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

ananicy-cpp and scx_bpfland, comparison and compatibility #1188

Closed
XZVB12 opened this issue Jan 13, 2025 · 2 comments
Closed

ananicy-cpp and scx_bpfland, comparison and compatibility #1188

XZVB12 opened this issue Jan 13, 2025 · 2 comments

Comments

@XZVB12
Copy link

XZVB12 commented Jan 13, 2025

Hello, I couldn’t find exact information about the compatibility of these two components and decided to ask here.
Should you use both or only one, will they conflict with each other ?
I ran Superposition Benchmark with two simultaneously and only with ananicy-cpp, the difference was at the level of inaccuracy.
SCX_SCHEDULER=scx_bpfland
SCX_FLAGS='-k -m performance'

If anyone can share their performance comparisons with scx vs ananicy-cpp I would be interested to know.
Thanks.

@arighi
Copy link
Contributor

arighi commented Jan 14, 2025

In general it is not recommended to run ananicy with bpfland, because bpfland is already prioritizing latency-sensitive tasks and ananicy can do the same (adjusting the task's niceness), so both effects can amplify such prioritization, leading to an excessive de-prioritization of cpu-intensive tasks.

However, that is not true in general, there might be some special cases where this extra prioritization can be beneficial. At the end, the best strategy is to test both ways and see which one works best for you. But keep in mind that you may hit some stall conditions with ananicy and bpfland running at the same time if you have lots of latency-sensitive and cpu-intensive tasks running at the same time.

Side note: I'd also recommend to drop -k from SCX_FLAGS if you're using a recent version of bpfland, as the kthread prioritization is not that useful with the latest changes in place.

@XZVB12
Copy link
Author

XZVB12 commented Jan 14, 2025

Thanks for the reply.

I'd also recommend to drop -k from SCX_FLAGS

In my tests -k showed a performance improvement, but not much.
Today I finished re-testing, it seems ananicy-cpp still gives higher performance on my kernel and hardware.
That was one of the reasons for starting this discussion, I was wondering what the results for other systems/kernel were if someone would be willing to share them. I checked all scheduler that could be run and work stably
I’ve attached the test results in case anyone is interested. In the games, the situation is similar to.
I will leave this discussion open for ~ week (if you allow) in case someone wants to add information and then close it.
Linux Kernel: 6.12.9-1-MANJARO.
test.zip

@XZVB12 XZVB12 closed this as completed Jan 19, 2025
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

No branches or pull requests

2 participants