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

VM work #88

Merged
merged 41 commits into from
Dec 31, 2023
Merged

VM work #88

merged 41 commits into from
Dec 31, 2023

Conversation

heatd
Copy link
Owner

@heatd heatd commented Sep 13, 2023

No description provided.

Signed-off-by: Pedro Falcato <[email protected]>
We use panic() in the file but forgot to include it.

Signed-off-by: Pedro Falcato <[email protected]>
Add an interval tree implementation based on lib/binary_search_tree's
augmented capabilities.

Signed-off-by: Pedro Falcato <[email protected]>
Add a get_per_cpu alternative that does not have volatile and thus can
be re-ordered/removed if the compiler chooses to.

Signed-off-by: Pedro Falcato <[email protected]>
These functions can in 99.9% of the cases be optimized out, so mark them
pure and use get_per_cpu_stable.

Signed-off-by: Pedro Falcato <[email protected]>
Add page reclamation code paths, more allocation flags and a cache
shrinking framework for caches to be dynamically sized back.

Signed-off-by: Pedro Falcato <[email protected]>
heatd added 11 commits October 6, 2023 01:19
map_page_list is broken and deprecated. Use mmiomap for the time being.

Signed-off-by: Pedro Falcato <[email protected]>
We forgot to do fence.i for the current, patching CPU. This is obviously
incorrect as the icache and dcache will dsync.

Signed-off-by: Pedro Falcato <[email protected]>
We were not calculating the load bias correctly, which led to crashes
when booting relocatable EFI multiboot2 kernels.

Signed-off-by: Pedro Falcato <[email protected]>
We were mismapping the physmap on higher memory (> 1GiB) machines.

Signed-off-by: Pedro Falcato <[email protected]>
Also separates MAP_PRIVATE handling, and removes some bits of old CoW
VMO leftovers.

Signed-off-by: Pedro Falcato <[email protected]>
heatd added 3 commits October 22, 2023 04:13
Rework munmap, mprotect into correct (one would hope) variants.
vma splitting now works correctly with vm_objects and with amaps.
amaps also gained split, truncate and hole punching.

Signed-off-by: Pedro Falcato <[email protected]>
Linuxize the name (I just like the VMA acronym!) and improve the
structure somewhat. Prefix vma members with vma_. Replace vma_pages
with vma_end.

Signed-off-by: Pedro Falcato <[email protected]>
pahole does not support generating type information for float/double.

Signed-off-by: Pedro Falcato <[email protected]>
heatd added 2 commits October 23, 2023 23:29
Signed-off-by: Pedro Falcato <[email protected]>
For future C compatibility...

Signed-off-by: Pedro Falcato <[email protected]>
@heatd heatd force-pushed the pedro/vm branch 2 times, most recently from df63bf3 to 4e8a750 Compare November 12, 2023 19:27
This commit includes many changes (some slightly unrelated) that all
build together to provide effective refactoring of the page cache.

- Filemap handles the generic page cache paths
- No one calls vmo_get apart from filemap
  - This means you cannot map a vmo using the page cache paths anymore, but only a file
    - This also means MAP_SHARED will need either its own tmpfs anon inode
      or its own fault_ops
  - Block devices now have their own superblock with their own inode
- You now do not need to hold a lock when doing page cache IO
- struct page grew page cache specific info (owner and pageoff) and we
  killed off struct page_cache_node

This commit, however, still leaves you with a borked MAP_SHARED and
borked writeback.

Signed-off-by: Pedro Falcato <[email protected]>
This follows linux's idea in keeping anonymous tmpfs inodes as the
backing for shared memory. Why? Because it's just useful, in case we
want to bother dabbling with tmpfs swapping in the future (as then shmem
gets it for free, and vice-versa).

Signed-off-by: Pedro Falcato <[email protected]>
Add a test that does a basic exercise of MAP_SHARED in anonymous memory,
since many boots don't actually get to exercise it at all.

Signed-off-by: Pedro Falcato <[email protected]>
Refactor filemap by unifying certain codepaths (e.g bbuffer and
filemap). This is done in preparation for writeback overhauling. As of
this commit, dirtying does not do anything, and writeback never happens.

Signed-off-by: Pedro Falcato <[email protected]>
Preparation for further refactoring.

Signed-off-by: Pedro Falcato <[email protected]>
This commit introduces per-zone page stat counting (sharding these
counters per-cpu). A few basic counters are introduced (but not yet
hooked up). These are: file pages, anon pages, dirty, writeback,
reclaimable slab pages, unreclaimable slab pages, and LRU stats for file
and anon. With these, struct page_pcpu_data fills exactly two 64-byte
cache lines, so it introduces minimal wastage.

Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Update ENABLE_SCREAM_EXCEPTION's code to work with the new vm changes.

Signed-off-by: Pedro Falcato <[email protected]>
Add --fsync and --fsync-dir, to sync the file and the file's parent dir.
This helps isolate and debug IO on the actual file.

Signed-off-by: Pedro Falcato <[email protected]>
Completely rework writeback functionality. It's now much more stable,
although still synchronous. New file_ops callbacks have been added
(writepages and fsyncdata).

Signed-off-by: Pedro Falcato <[email protected]>
Previously, we forgot locking the cache when freeing an object from the
quarantine. This fixes it. While we're at it, add asserts to the slab
queues (but disabled by default, even when debugging, as walking through
a linked list N times is horrendously expensive).

Also, in the meanwhile, add GFP_ATOMIC as the default malloc() flag.
This is bad, but it's better than not being able to kick off paged.

Signed-off-by: Pedro Falcato <[email protected]>
This fixes crashes when touching uninitialized data, after splitting.

Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
The VMO was unused anyway, and it doesn't make much sense.

Signed-off-by: Pedro Falcato <[email protected]>
@heatd heatd marked this pull request as ready for review December 31, 2023 04:32
@heatd heatd merged commit 8f02bfc into master Dec 31, 2023
3 checks passed
@heatd heatd deleted the pedro/vm branch December 31, 2023 04:33
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