This is done after the similar change in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=574823bfab82d9d8fa47f422778043fbb4b4f50e.
The article: https://arxiv.org/abs/1901.01161
Details
- Reviewers
alc markj - Group Reviewers
manpages - Commits
- rS342853: Add a tunable which changes mincore(2) algorithm to only report data
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
The mincore(2) man page should be updated as well.
Should we bother keeping the old behaviour at all if Linux does not?
sys/vm/vm_mmap.c | ||
---|---|---|
814 ↗ | (On Diff #52610) | Maybe something like: /* * We only care about this pmap's mapping of the page, if any. */ to match the other comments? |
I believe that yes, old behavior is useful for introspection tools. This is demonstrated by the article which causes that Linux commit. So even if somebody does not want that, others might do.
lib/libc/sys/mincore.2 | ||
---|---|---|
50 ↗ | (On Diff #52611) | This isn't really accurate: now it only determines whether the page is mapped. |
92 ↗ | (On Diff #52611) | "mappings of the pages in the specified virtual address range" |
93 ↗ | (On Diff #52611) | "the system" |
97 ↗ | (On Diff #52611) | I'd be explicit here and add, "Otherwise, all mappings of resident pages in the specified address range are examined." |
lib/libc/sys/mincore.2 | ||
---|---|---|
50 ↗ | (On Diff #52611) | I think "a sysctl value" or "depending on the value of .Va vm.mincore_mapped" would sound more natural. |
I also updated the last sentence in the DESCRIPTION section that tries to explain the '0' sysctl operations. It was very confusing by referencing mappings where the real algorithm examines pages regardless of mappings presence.
sys/vm/vm_mmap.c | ||
---|---|---|
102 ↗ | (On Diff #52619) | Given that there is a security context for this change, would it make sense to make use of CTLFLAG_SECURE for this sysctl node? |