oxidecomputer / oxidecomputer/crucible
upstairs perf: too many job-scans in gone_too_long
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 260
- Forks
- 34
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 8
Description
fair bit of time in total_live_work at low IO request sizes with my crudd tests. 15% of the flamegraph at 256-block requests, and like 40% at 16-block requests.
thats getting called in gone_too_long after every process_new_io. the point of gone_too_long is to see if there's too many outstanding IOs (1000) to mark the downstairs as being problematic. and i wonder if we could just like. call it a little less frequently.
flamegraphs, if you want to see them for yourself:
2023-05-17-crudd-full-flamegraph.zip
these are a couple weeks old at this point but were run on perfwork before it was merged, iirc.
anyways, we could maybe try to re-invent total_live_work to not be linearly traversing the set of jobs via more accounting variables. or maybe we could just call it less often. i dont think we need to call it after every single IO request comes in from the guest.
Something like running it when an IO request comes in, but only if its been EITHER <some period of time> since the last time we ran it OR <some amount of issued requests since we last ran it> might be a bit nicer, while still catching a wedged downstairs early enough that it doesn't become a problem.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in upstairs/src/lib.rs around lines 10017-10023 and trace process_new_io, gone_too_long, and total_live_work. Review the linked flamegraph and determine whether reducing call frequency or changing the accounting approach preserves the check for too many outstanding I/Os while reducing job scans.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100