scx_rusty: Temporary fix of duplicate active tptr #941
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Under severe load unbalance scenario such as mixtures of CPU-insensive workload and I/O-intensive worload, same tptr may be written into the same dom_active_tptrs's array.
It will lead to load balancer's failure because when the tptr task contains large enough load, it tends be to selected so warnings about same tptr being set in "lb_data" will continue to pop up.
Use a workaround for now , which is to keep a
HashSet
in userspace recording the current active tptr under a domain, and do not generate the same task repeatedly.Test
The test ran on AMD Ryzen 7 5700X3D 8-Core Processor , architecture is x86_64
Reproduce the bug
Because my machine is small and doesn't have multiple NUMA nodes, we utilize the following command to create several logical domains
After
scx_rusty
is loaded and running successfully, open another terminal and start to compile a kernelAnd you should see many warnings starting to popping up
If you try to add a debug print inside
populate_tasks_by_load()
like the following ( from line 682)You should see the problem actually rise from this function.