Skip to content

Add PR_SET_MEMORY_MERGE and PR_GET_MEMORY_MERGE for linux#5060

Open
fspv wants to merge 1 commit intorust-lang:mainfrom
fspv:add-pr-memory-merge-linux
Open

Add PR_SET_MEMORY_MERGE and PR_GET_MEMORY_MERGE for linux#5060
fspv wants to merge 1 commit intorust-lang:mainfrom
fspv:add-pr-memory-merge-linux

Conversation

@fspv
Copy link
Copy Markdown

@fspv fspv commented Apr 15, 2026

Description

Add PR_SET_MEMORY_MERGE and PR_GET_MEMORY_MERGE prctl constants for the linux target. These control per-process opt-in to KSM and have been available since kernel 6.4. They were already defined for the android target but missing from linux.

Sources

https://github.com/torvalds/linux/blob/08ee1559052be302f1d3752f48360b89517d9f8d/include/uapi/linux/prctl.h#L316-L317

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget); especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

@rustbot rustbot added S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Apr 15, 2026
@fspv
Copy link
Copy Markdown
Author

fspv commented Apr 15, 2026

there is some musl-related failure, fixing

Copy link
Copy Markdown
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash but LGTM

View changes since this review

@fspv fspv force-pushed the add-pr-memory-merge-linux branch 2 times, most recently from cbff91d to a3cae8b Compare April 16, 2026 09:09
@fspv
Copy link
Copy Markdown
Author

fspv commented Apr 16, 2026

squashed, but CI is probably overloaded, checks timed out

Add `PR_SET_MEMORY_MERGE` and `PR_GET_MEMORY_MERGE` prctl constants for the linux target. These control [per-process opt-in to KSM](https://lwn.net/Articles/953141/) and have been available since kernel 6.4. They were already defined for the android target but missing from linux
@fspv fspv force-pushed the add-pr-memory-merge-linux branch from a3cae8b to 91e4c61 Compare April 16, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants