rr-debugger / rr-debugger/rr

Scalability to high numbers of threads suffers due to `try_wait()` calls

Open
#3,371 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.7k
Forks
662
Avg merge
2d 3h
Merged PRs (30d)
2

Description

For an application with thousands of threads of equal priority, rr context switching can get very slow due to find_next_runnable_task, calling is_task_runnable on each thread, which in many cases (e.g. when almost all threads are blocked) calls RecordTask::try_wait which calls waitpid. I have an application with 2400 threads where rr spends almost all time in that waitpid syscall.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at find_next_runnable_task and follow its is_task_runnable path into RecordTask::try_wait, focusing on the waitpid calls described in the report. Reproduce or profile the workload with thousands of equal-priority threads, then define completion as avoiding the reported scalability bottleneck without changing scheduling behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
devtools, operating-systems, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.