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

VM2 #123

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft

VM2 #123

wants to merge 24 commits into from

Conversation

heatd
Copy link
Owner

@heatd heatd commented Jul 14, 2024

No description provided.

@heatd heatd force-pushed the pedro/vm2 branch 2 times, most recently from e90aafe to 87ff1a3 Compare July 15, 2024 02:42
heatd added 8 commits July 23, 2024 02:16
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
What seems to be an innocent check doesn't actually work, since pages
can be unmapped by a variety of reasons (e.g truncation), and
mapcount = 0 && ref > 1 doesn't exactly mean it's a leaked page.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
The comparison was wrong and the signal setting was wrong too.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Lets start progressively switching architectures to the shared code.
First off, x86.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
fsyncdata provides fsync/writeback-like semantics like regular
writeback-needing filesystems, and allows us to pass tests/emulate
fsync/msync/fsyncdata as required.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Switch riscv64 to the new page table code, and add a few new wrappers
and headers (pmd_mkpmd, et al). This commit also fixed fork() breakage
that was introduced at some unknown point in time.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
heatd added 6 commits July 26, 2024 00:34
Add kmem_cache_alloc_bulk and free_bulk, which allow us to allocate
objects in batches, as efficiently as the allocator allows (avoiding
relocking or a preempt-off/preempt-on dance).

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Add GFP_NOWAIT and a linux-compat helper.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Add Maple Tree, an RCU-ready btree implementation. Taken from Linux,
commit d67978318827d06f1c0fa4c31343a279e9df6fde.

Relevant xarray bits are also copied over.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
@heatd heatd force-pushed the pedro/vm2 branch 2 times, most recently from 88a3c9a to 14b50c9 Compare July 26, 2024 00:02
The maple tree is faster, allows for RCU *and* gives us efficient range
allocation for free. Yay!

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
heatd added 4 commits July 27, 2024 03:06
We botched redzone aligning for a good while, which resulted in
alignment problems when freeing (particularly if the caller
expected a certain alignment for pointer bit usage, like maple tree).

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
We were leaking packetbufs as we didn't unref them after going down the
stack.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
So, it turns out we were assuming we assuredly had mapcount = 0 after
unmapping, since we held the lock. This somewhat makes sense, but misses
the edge case of a fork happening (incrementing mapcount) and not being
seen by the unmap code. So, instead of CHECK()ing for mapcount = 0, just
return failure to remove the page. This should activate the page and
guarantee forward progress.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Instead of maintaing a separate data layer (amaps), store the pages in
the page tables. After mapping a new anon, put the page. This results in
the page's mapcount working like an automatic anon page refcount. While
on it, we also implement an optimization where CoW'ing anon pages with
mapcount = 1 do not get copied, but rather reused and remapped writable.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
heatd added 2 commits July 27, 2024 23:51
Refactor sys_mmap, simplifying and organizing the code. This should also
result in a nice speedup.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Delete and staticify a *lot* of stuff.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
heatd added 2 commits July 28, 2024 00:27
Collapse vm_maptype into vm_flags.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Add vma merging capabilities for mmap.

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
@heatd
Copy link
Owner Author

heatd commented Jul 29, 2024

Stale (has been merged together with #124). Spinning up this branch with more stuff Soon(tm)

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.

1 participant