Skip to content

Add PR_SET_MEMORY_MERGE and PR_GET_MEMORY_MERGE for linux#5060

Merged
JohnTitor merged 1 commit intorust-lang:mainfrom
fspv:add-pr-memory-merge-linux
Apr 22, 2026
Merged

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

Conversation

@fspv
Copy link
Copy Markdown
Contributor

@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
Contributor 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
Contributor Author

fspv commented Apr 16, 2026

squashed

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
Copy link
Copy Markdown
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

@JohnTitor JohnTitor added this pull request to the merge queue Apr 22, 2026
Merged via the queue into rust-lang:main with commit 545663c Apr 22, 2026
52 checks passed
@JohnTitor JohnTitor mentioned this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants