Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
heed review comments
  • Loading branch information
Gabriel Schulhof committed Dec 17, 2019
commit a93064db81577630a5309872f567c88e8df97c09
12 changes: 11 additions & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -984,15 +984,25 @@ InitializationResult InitializeOncePerProcess(int argc, char** argv) {
}
}

#if defined(NODE_ENABLE_LARGE_CODE_PAGES) && NODE_ENABLE_LARGE_CODE_PAGES
if (per_process::cli_options->use_largepages == 1 ||
per_process::cli_options->use_largepages == 2) {
if (node::IsLargePagesEnabled()) {
Comment thread
gabrielschulhof marked this conversation as resolved.
if (node::MapStaticCodeToLargePages() != 0 &&
per_process::cli_options->use_largepages == 2) {
fprintf(stderr, "Reverting to default page size\n");
fprintf(stderr,
"Mapping code to large pages failed. Reverting to default page "
"size.\n");
}
} else if (per_process::cli_options->use_largepages == 2) {
fprintf(stderr, "Large pages are not enabled.\n");
}
}
#else
if (per_process::cli_options->use_largepages == 2) {
fprintf(stderr, "Mapping to large pages is not supported.\n");
}
#endif // NODE_ENABLE_LARGE_CODE_PAGES

if (per_process::cli_options->print_version) {
printf("%s\n", NODE_VERSION);
Expand Down
3 changes: 1 addition & 2 deletions test/parallel/test-startup-large-pages.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

// A sanity check: Make sure that Node.js runs correctly when running with the
// --use-largepages option.
// Make sure that Node.js runs correctly with the --use-largepages option.

require('../common');
const assert = require('assert');
Expand Down