Conversation
Move MADV_MERGEABLE part of ksm_madvise() into a dedicated helper since it will be further used for marking VMAs to be merged forcibly. This does not bring any functional changes. Signed-off-by: Oleksandr Natalenko <oleksandr@redhat.com>
Move MADV_UNMERGEABLE part of ksm_madvise() into a dedicated helper since it will be further used for unmerging VMAs forcibly. This does not bring any functional changes. Signed-off-by: Oleksandr Natalenko <oleksandr@redhat.com>
Yes, I know, this looks like a duplicate of `process_madvise()`. There are two reasons to do this, however: 1. implementing a new syscall is exceptionally easy and takes less code lines than ugly `/proc`-based API, although it imposes slightly more difficult usage onto userspace 2. the code gets actually much closer to be merged with `process_madvise()`, and this is a small step in that direction. So, basically, the `pmadv_ksm()` syscall is a twin of `process_madvise()`, but with two differences: 1. it works with MADV\_(UN)\?MERGEABLE hints only 2. it affects the whole address space of the target task The second difference is likely to disappear in case two syscalls are merged, but that's up to either me or to someone else to re-think how to do it. uksmd is already able to use this syscall. Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Present `pmadv_ksm()` syscall for all the arches. Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
As `pmadv_ksm()` syscall is out-of-tree, maintain a separate `/sys/kernel/pmadv/ksm` file with a syscall number so that userspace tools can always know what to use in runtime even if the syscall number shifts after adding another in-tree syscall. The idea is borrowed from futex2 submission. Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Owner
Author
|
Rebased to #27 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Export patch series: https://github.com/kakra/linux/pull/25.patch