Use MAP_SHARED for 1G huge pages
Summary:
In order to avoid copy-on-write (which results in additional copies of huge pages), we mark 1G pages SHARED.
The understanding here is that child processes of HHVM shouldn't really write to the pages, so we forbid it just to be safe.
Maybe we can forbid reads as well, or simply use madvise DONTFORK.
While we test these, only forbidding writes feels a bit safer.
If we need to fork() and execute php code, fail if 1G pages are not used.
Differential Revision:
D4099950
fbshipit-source-id:
e9b6632786e66a611cafbd2084c83d0563c46ac0