Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
devnexen committed Jul 22, 2019
commit 2b1d649cb1a588ce7b750e3329fda9cbca8a68fb
12 changes: 7 additions & 5 deletions src/large_pages/node_large_page.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,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;
}
Expand Down