Skip to content

feat: round robin selection in virtualizers#4818

Open
frihetselsker wants to merge 1 commit into
tock:masterfrom
OxidosAutomotive:virt/rr
Open

feat: round robin selection in virtualizers#4818
frihetselsker wants to merge 1 commit into
tock:masterfrom
OxidosAutomotive:virt/rr

Conversation

@frihetselsker
Copy link
Copy Markdown

Pull Request Overview

This pull request fixes the fairness problem of virtual devices. The solution iterates the devices list in a round robin manner and is introduced at every multiplexer (except VirtualTimer and VirtualMuxAlarm which have different implementation). For more details, please refer to #4802.

Testing Strategy

This pull request was tested by using a custom kernel of qemu_rv32_virt with UART peripheral, and three equivalent applications that try to use printf() simultaneously.

TODO or Help Wanted

Feedback

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

AI Use

  • The PR description details my use of AI in the production of the
    code in this PR, if any, and I have manually checked and
    personally certify the entire contents of this PR.

No AI was used in this PR.

@alexandruradovici
Copy link
Copy Markdown
Contributor

I am not sure why the CI fails, but it does not seem to be due to the modified code.

@bradjc
Copy link
Copy Markdown
Contributor

bradjc commented May 6, 2026

Can we create a RoundRobinList type? This is a lot of boilerplate to copy and it is hard to quickly determine what priority algorithm any mux is using.

@alevy
Copy link
Copy Markdown
Member

alevy commented May 6, 2026

Some of the test are failing because this new round-robin policy results (as expected and correctly) in interleaved UART messages between the kernel and applications which in main aren't surfacing because of the unfair scheduler.

This is basically a problem with the tests, not the implementation or policy in this PR, but we need to fix those tests in order to merge this. It's still unclear how to best fix those tests yet, so investigating and suggestions welcome.

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

Successfully merging this pull request may close these issues.

4 participants