Kernel/Memory: Various fixes for anonymous mmaps
This PR fixes the following problems related to anonymous mmaps:
- After a fork, writes to an anonymous mmap cause redundant page faults (#24637)
- Writes to a shared anonymous mmap are not visible to other processes that share the mmap (#24638)
- VMObject::try_clone() overcommits pages to m_shared_committed_cow_pages
This PR also adds more test cases for anonymous mmaps.
Hello!
One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.
@spholz You know this code a bit, right? Want to look at this? :)
Seems like one of the other kernel PRs created some conflicts
Seems like one of the other kernel PRs created some conflicts
Fixed, it was some new code in Region.cpp that didn't impact any functionality of this PR.
Thanks!
Since you're in this part of the code: If you're looking for things to do, it'd be nice if posix_spawn() could become a syscall instead of being implemented in userspace. We could save the time needed to copy page metadata then. Most processes are launched using posix_spawn() in serenity, so that might help with performance.
Thanks!
Since you're in this part of the code: If you're looking for things to do, it'd be nice if
posix_spawn()could become a syscall instead of being implemented in userspace. We could save the time needed to copy page metadata then. Most processes are launched usingposix_spawn()in serenity, so that might help with performance.
I appologise if commenting on a closed PR is the incorrect form to ask: but is this still something that would be interesting to do? From what I can tell it is still implemented as a library function and not a system call. Could I start work on a PR to make it a system call?
That'd be great!
Look ma I'm famous!!