scx_chaos: separate kprobe delays #2435
Merged
+51
−13
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.
Previously, kprobe random delays where tied to the standard random delays. This also included a bug where one would be required to set the random delay frequency argument, even after setting the kprobe delay frequency argument.
This PR decouples kprobe delays from random delays by creating a new "trait" (it still is triggered differently than the other traits and is not placed into the trait array) and adding independent args for kprobes. This also allows one to use random delays and kprobe delays with different settings.
Testing:
scx_chaos --stats 1 --kprobes-for-random-delays schedule --kprobe-random-delay-min-us 100 --kprobe-random-delay-max-us 10000
for > 30 minutes, once with default frequency and once with--kprobe-random-delay-frequency .5
. Statistics show that kprobe delays occur regularly and the numbers line up with the different frequencies.