Skip to content

[6.1] Track PF uksmd patches - #25

Closed
kakra wants to merge 5 commits into
base-6.1from
rebase-6.1/pf-ksm
Closed

[6.1] Track PF uksmd patches#25
kakra wants to merge 5 commits into
base-6.1from
rebase-6.1/pf-ksm

Conversation

@kakra

@kakrakakra commented Mar 11, 2023

Copy link
Copy Markdown
Owner

Export patch series: https://github.com/kakra/linux/pull/25.patch

  • post-factum KSM patches: for use with uksmd, merges identical memory pages to reduce cache and memory pressure, useful when running similar containers in parallel

pfactumand others added 5 commits December 11, 2022 23:29
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>
@kakra
kakra changed the base branch from master to base-6.1March 11, 2023 15:55
@kakra
kakra marked this pull request as draft March 11, 2023 16:20
@kakra

Copy link
Copy Markdown
OwnerAuthor

Rebased to #27

@kakrakakra closed this Nov 26, 2023
@kakrakakra added the done To be superseded by next LTS label Nov 26, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doneTo be superseded by next LTS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kakra@pfactum