Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 32 bit pointer for SubmissionQueue to shrink AsyncFd #110

Open
Thomasdezeeuw opened this issue Apr 13, 2024 · 0 comments
Open

Use 32 bit pointer for SubmissionQueue to shrink AsyncFd #110

Thomasdezeeuw opened this issue Apr 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Thomasdezeeuw
Copy link
Owner

At the time of writing the AsyncFd is an fd and a SubmissionQueue. An fd is 4 bytes (i32) and SubmissionQueue is an Arc<SharedSubmissionQueue>, so a pointer of 8 bytes (assuming 64 bit architecture). With padding this means AsyncFd is 16 bytes (4 + 8 + 4 bytes of padding), or four times larger than just a file descriptor.

If we can compress the 8 byte pointer to 4 bytes than the size of AsyncFd would only be 8 bytes (4 + 4), or half of it's current size. We can mmap(2) the memory using MAP_32BIT to ensure the OS gives us a 32 bit pointer. It does likely mean we can't use an Arc any more and we'll have to do the reference counting ourselves.

@Thomasdezeeuw Thomasdezeeuw added the enhancement New feature or request label Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant