microsoft / microsoft/demikernel

[runtime] More accurate timeouts with rdtsc

Open
#1,226 0 comments 0 reactions 1 assignee View on GitHub

@anandbonde is already working on this.

Since May 15, 2024.

enhancement
Dominant language
Rust
Stars
1.2k
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Context

Currently we use a configurable value for timer resolution which is based on the number of iterations that we run the scheduler. Since our tasks vary in runtime, this is an extremely imprecise way to decide when to check the system time for a timeout.

Proposed Solution

Use rdtsc to estimate a cycle budget that matches how frequently we want to check the time. For example, 1 second = roughly 2.6 million cycles on a 2.6Ghz CPU. Once we run out the budget, we take the system time and figure out how long it actually took for each cycle. Then we adjust the budget for the next iteration based on that.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.