Page MenuHomeFreeBSD

mprotect.2: Remove legacy BSD text
ClosedPublic

Authored by brooks on Sep 1 2021, 9:28 PM.

Details

Summary

This text dates to the BSD 4.4 import and is misleading. The mprotect
syscall acts on page granularity and breaks up mappings as required to
do so.

Note that with the addition of non-transparent superpages (aka
largepages) the size of a page at a given address may vary. This
commit does not attempt to address the lack of documentation of this
feature.

Sponsored by: DARPA

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

brooks requested review of this revision.Sep 1 2021, 9:28 PM
This revision is now accepted and ready to land.Sep 1 2021, 9:31 PM

Per the discussion in D30442 this removes the incorrect description of mprotect granularity. Documentation of large pages is left for later.

Ultimately, I think that the text will have to grow a new paragraph: (1) mentioning the possible existence of large page sizes on some architectures (See getpagesizes()); (2) that if the specified range does not cover an entire large page, the system will either demote the page mapping to a sufficiently small size or return an error, depending on whether the large page was created automatically or explicitly via shm_open(). In particular, I see no way of describing this without introducing the notion of demotion.

This revision was automatically updated to reflect the committed changes.