[php-src] PR #23574: ext/opcache: drop the pre-emptive munmap before the huge page remap
| From: | s2x | Date: | Fri, 04 Sep 2026 21:48:15 +0000 |
| Subject: | [php-src] PR #23574: ext/opcache: drop the pre-emptive munmap before the huge page remap | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38312@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23574
Author: s2x
Follow-up to #23554, suggested by @arnaud-lb:
MAP_FIXED already replaces the overlapped
part of the reservation, so the munmap() before it is unnecessary and only opens a
window for another thread to take the address.
This keeps the reservation, maps the huge pages into it, and releases only the head and the tail
that are left over — they always add up to huge_page_size. On failure the whole
reservation is released, because a failed MAP_FIXED can leave
a hole in it.
As with my last patch, please check this carefully. This part of the code is still new to me.