diff options
author | David Carlier <devnexen@gmail.com> | 2019-07-17 21:26:14 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-07-31 00:53:45 +0300 |
commit | de88d6c18796ad31edd1dbf4af102c4b05c64684 (patch) | |
tree | 0e77c01b54000346eb98e8ff01cd7ee2dc62a1fc /src/large_pages | |
parent | 4a1502bc4a89037fbcc9fae39e4a103f43cf9d83 (diff) |
src: large pages fix FreeBSD fix region size
Makes the size aligned to huge page size by
calculating it from the aligned lower and upper
boundary of the executable address.
PR-URL: https://github.com/nodejs/node/pull/28735
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/large_pages')
-rw-r--r-- | src/large_pages/node_large_page.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/large_pages/node_large_page.cc b/src/large_pages/node_large_page.cc index e6829708aa0..d87ccfaa26a 100644 --- a/src/large_pages/node_large_page.cc +++ b/src/large_pages/node_large_page.cc @@ -199,12 +199,14 @@ static struct text_region FindNodeTextRegion() { (entry->kve_protection & KVME_PROT_EXEC)); if (!strcmp(exename.c_str(), entry->kve_path) && excmapping) { - size_t size = entry->kve_end - entry->kve_start; + char* estart = + reinterpret_cast<char*>(hugepage_align_up(entry->kve_start)); + char* eend = + reinterpret_cast<char*>(hugepage_align_down(entry->kve_end)); + size_t size = eend - estart; nregion.found_text_region = true; - nregion.from = - reinterpret_cast<char*>(hugepage_align_up(entry->kve_start)); - nregion.to = - reinterpret_cast<char*>(hugepage_align_down(entry->kve_end)); + nregion.from = estart; + nregion.to = eend; nregion.total_hugepages = size / hps; break; } |