Pick 50b473c8839f5408df179bdf6f2b3fd2cf5c3b2f from upstream:

Set commit properly for FreeBSD w/ overcommit.

    When overcommit is enabled, commit needs to be set when doing mmap().  The
    regression was introduced in f80c97e.

This fixes 'retain:true'.

Discussed with:	jasone
Obtained from:	Qi Wang <interwq at gwu dot edu>
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
This commit is contained in:
Edward Tomasz Napierala 2018-11-06 12:05:46 +00:00
parent 4805dd68d6
commit 086165ecb5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=340177

View file

@ -186,6 +186,10 @@ pages_map(void *addr, size_t size, size_t alignment, bool *commit) {
* touching existing mappings, and to mmap with specific alignment.
*/
{
if (os_overcommits) {
*commit = true;
}
int prot = *commit ? PAGES_PROT_COMMIT : PAGES_PROT_DECOMMIT;
int flags = mmap_flags;