Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

[TODO] mmap() file mapping & shared [file] mapping #39

Open
MarcoCicognani opened this issue Jan 25, 2023 · 6 comments
Open

[TODO] mmap() file mapping & shared [file] mapping #39

MarcoCicognani opened this issue Jan 25, 2023 · 6 comments
Assignees
Labels
suggestion New feature or request

Comments

@MarcoCicognani
Copy link
Contributor

Suggestion

Hi Aaron,
Good to see you still working on the VM subsystem.

I put this issue as a memo for the missing features of the mmap() implementation.
I hope you are already at work on it.

Keep going man!

@MarcoCicognani MarcoCicognani added the suggestion New feature or request label Jan 25, 2023
@byteduck
Copy link
Owner

Yep, that's exactly what I'm going to add next :) the hope is to use it in the linker to map program segments into memory to hopefully speed things up a little.

@MarcoCicognani
Copy link
Contributor Author

It could be cool if the file mapping uses the VFS layer page-cache to share pages, in order to reduce memory usage

@byteduck
Copy link
Owner

That's what I'm hoping to do. Right now, the disk is cached at the block level, so it would rely on files being aligned at page boundaries. I may have to rework the VFS cache a little too.

@MarcoCicognani
Copy link
Contributor Author

That's cool man!
Waiting for updates

@byteduck
Copy link
Owner

Update on this:

I've got inode mappings working on a basic level. Shared and private mappings both work, but more can definitely be done to speed things up. In no particular order, here's a list of things I still need to do:

  • Allow for the partial copy-on-write of VMObjects. As in, copy each page as needed rather than copying the whole object when one page is written to.
  • When mapping an inode privately with write permissions, use the shared mapping pages and mark them as CoW to speed things up.
  • Add mremap and msync.
  • Eliminate the block-level cache and just use the shared inode cache instead.
  • Rewrite ld to use memory-mapped files to reduce memory usage as well as speed things up.

@MarcoCicognani
Copy link
Contributor Author

Great Man!

@byteduck byteduck self-assigned this Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
suggestion New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants