Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

AccountsDb Async Fetching Service #17765

Closed
jon-chuang opened this issue Jun 6, 2021 · 0 comments
Closed

AccountsDb Async Fetching Service #17765

jon-chuang opened this issue Jun 6, 2021 · 0 comments
Labels
stale [bot only] Added to stale content; results in auto-close after a week.

Comments

@jon-chuang
Copy link
Contributor

jon-chuang commented Jun 6, 2021

Problem

Currently, MMap access can trigger page fault. Typical usage is sequential load_with_fixed_root.

Proposed Solution

The solution is an AccountsDb async worker pool that context switches to interleave page faults.

The design is as follows: AccountsDb or Accounts exposes some methods that rely on async workers instead of sequentially performing IO.

TO DO: MORE DETAILS

Choices and Evidence

According to https://github.com/jimblandy/context-switch, a tokio context switch (similar to go green threads), is lower than kernel thread context switch/thread creation. (although apparently not for blocking IO 😢 )

An alternative is may, which implements something similar to coroutines: example use

While asking a threadpool to perform IO would actually increase the IO time in the non-page fauting case, this time is actually very small and doesn't add much to the critical path. But, it can drastically reduce the time waiting around for page faults, possible even on Optane-like low latency SSDs.

@github-actions github-actions bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Dec 20, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale [bot only] Added to stale content; results in auto-close after a week.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant