Skip to content

Commit 15940ef

Browse files
committed
build,src: make --use-largepages a no-op
This feature has not been actively used in the wild and has always only been best-effort on systems that support it. The build changes it needs breaks WSL1 compatibility and the relocation mechanism won't work with newer V8 that remaps builtins using mremap(MREMAP_DONTUNMAP). This patch effectively removes this feature by turning the flags into no-ops. A warning will be printed if `--use-largepages=on` is used. Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com> PR-URL: #65389 Fixes: #63735 Fixes: #64408 Refs: https://chromium-review.googlesource.com/c/v8/v8/+/7985687 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 610fcd8 commit 15940ef

15 files changed

Lines changed: 51 additions & 646 deletions

LICENSE

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2600,29 +2600,6 @@ The externally maintained libraries used by Node.js are:
26002600
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26012601
"""
26022602

2603-
- large_pages, located at src/large_pages, is licensed as follows:
2604-
"""
2605-
Copyright (C) 2018 Intel Corporation
2606-
2607-
Permission is hereby granted, free of charge, to any person obtaining a copy
2608-
of this software and associated documentation files (the "Software"),
2609-
to deal in the Software without restriction, including without limitation
2610-
the rights to use, copy, modify, merge, publish, distribute, sublicense,
2611-
and/or sell copies of the Software, and to permit persons to whom
2612-
the Software is furnished to do so, subject to the following conditions:
2613-
2614-
The above copyright notice and this permission notice shall be included
2615-
in all copies or substantial portions of the Software.
2616-
2617-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2618-
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2619-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
2620-
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
2621-
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2622-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
2623-
OR OTHER DEALINGS IN THE SOFTWARE.
2624-
"""
2625-
26262603
- caja, located at lib/internal/freeze_intrinsics.js, is licensed as follows:
26272604
"""
26282605
Adapted from SES/Caja - Copyright (C) 2011 Google Inc.

configure.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -884,13 +884,13 @@
884884
action='store_true',
885885
dest='node_use_large_pages',
886886
default=None,
887-
help='This option has no effect. --use-largepages is now a runtime option.')
887+
help='This option is no longer supported and a no-op.')
888888

889889
parser.add_argument('--use-largepages-script-lld',
890890
action='store_true',
891891
dest='node_use_large_pages_script_lld',
892892
default=None,
893-
help='This option has no effect. --use-largepages is now a runtime option.')
893+
help='This option is no longer supported and a no-op.')
894894

895895
parser.add_argument('--use-section-ordering-file',
896896
action='store',
@@ -2047,10 +2047,8 @@ def configure_node(o):
20472047

20482048
if options.node_use_large_pages or options.node_use_large_pages_script_lld:
20492049
warn('''The `--use-largepages` and `--use-largepages-script-lld` options
2050-
have no effect during build time. Support for mapping to large pages is
2051-
now a runtime option of Node.js. Run `node --use-largepages` or add
2052-
`--use-largepages` to the `NODE_OPTIONS` environment variable once
2053-
Node.js is built to enable mapping to large pages.''')
2050+
have no effect. Mapping the Node.js static code to large pages is
2051+
no longer supported.''')
20542052

20552053
if options.no_ifaddrs:
20562054
o['defines'] += ['SUNOS_NO_IFADDRS']

doc/api/cli.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3486,19 +3486,21 @@ When both are set, `--use-env-proxy` takes precedence.
34863486
added:
34873487
- v13.6.0
34883488
- v12.17.0
3489+
changes:
3490+
- version: REPLACEME
3491+
pr-url: https://github.com/nodejs/node/pull/65389
3492+
description: This option is now a no-op.
34893493
-->
34903494

3491-
Re-map the Node.js static code to large memory pages at startup. If supported on
3492-
the target system, this will cause the Node.js static code to be moved onto 2
3493-
MiB pages instead of 4 KiB pages.
3495+
This option is no longer supported and a no-op. It used to re-map the Node.js
3496+
static code to large memory pages at startup.
34943497

3495-
The following values are valid for `mode`:
3498+
It still accepts the following values for compatibility:
34963499

34973500
* `off`: No mapping will be attempted. This is the default.
3498-
* `on`: If supported by the OS, mapping will be attempted. Failure to map will
3499-
be ignored and a message will be printed to standard error.
3500-
* `silent`: If supported by the OS, mapping will be attempted. Failure to map
3501-
will be ignored and will not be reported.
3501+
* `on`: No mapping will be attempted and a message will be printed to
3502+
standard error stating it's no longer supported.
3503+
* `silent`: Same as `off`.
35023504

35033505
### `--use-system-ca`
35043506

doc/node-config-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@
754754
},
755755
"use-largepages": {
756756
"type": "string",
757-
"description": "Map the Node.js static code to large pages. Options are 'off' (the default value, meaning do not map), 'on' (map and ignore failure, reporting it to stderr), or 'silent' (map and silently ignore failure)"
757+
"description": "This option is no longer supported and a no-op. Options are 'off' (default), 'on' (report a warning to stderr), or 'silent' (same as 'off')."
758758
},
759759
"use-openssl-ca": {
760760
"type": "boolean",

doc/node.1

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,19 +1691,17 @@ This is equivalent to setting the \fBNODE_USE_ENV_PROXY=1\fR environment variabl
16911691
When both are set, \fB--use-env-proxy\fR takes precedence.
16921692
.
16931693
.It Fl -use-largepages Ns = Ns Ar mode
1694-
Re-map the Node.js static code to large memory pages at startup. If supported on
1695-
the target system, this will cause the Node.js static code to be moved onto 2
1696-
MiB pages instead of 4 KiB pages.
1697-
The following values are valid for \fBmode\fR:
1694+
This option is no longer supported and a no-op. It used to re-map the Node.js
1695+
static code to large memory pages at startup.
1696+
It still accepts the following values for compatibility:
16981697
.Bl -bullet
16991698
.It
17001699
\fBoff\fR: No mapping will be attempted. This is the default.
17011700
.It
1702-
\fBon\fR: If supported by the OS, mapping will be attempted. Failure to map will
1703-
be ignored and a message will be printed to standard error.
1701+
\fBon\fR: No mapping will be attempted and a message will be printed to
1702+
standard error stating it's no longer supported.
17041703
.It
1705-
\fBsilent\fR: If supported by the OS, mapping will be attempted. Failure to map
1706-
will be ignored and will not be reported.
1704+
\fBsilent\fR: Same as \fBoff\fR.
17071705
.El
17081706
.
17091707
.It Fl -use-system-ca

node.gyp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,6 @@
235235
'src/histogram-inl.h',
236236
'src/js_stream.h',
237237
'src/json_utils.h',
238-
'src/large_pages/node_large_page.cc',
239-
'src/large_pages/node_large_page.h',
240238
'src/memory_tracker.h',
241239
'src/memory_tracker-inl.h',
242240
'src/module_wrap.h',
@@ -503,11 +501,6 @@
503501
'node_mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)node_mksnapshot<(EXECUTABLE_SUFFIX)',
504502
'node_js2c_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)node_js2c<(EXECUTABLE_SUFFIX)',
505503
'conditions': [
506-
['GENERATOR == "ninja"', {
507-
'node_text_start_object_path': 'src/large_pages/node_text_start.node_text_start.o'
508-
}, {
509-
'node_text_start_object_path': 'node_text_start/src/large_pages/node_text_start.o'
510-
}],
511504
[ 'node_shared=="true"', {
512505
'node_target_type%': 'shared_library',
513506
'node_lib_type': 'shared_library',
@@ -585,19 +578,6 @@
585578
},
586579

587580
'targets': [
588-
{
589-
'target_name': 'node_text_start',
590-
'type': 'none',
591-
'conditions': [
592-
[ 'OS in "linux freebsd solaris openharmony" and '
593-
'target_arch=="x64"', {
594-
'type': 'static_library',
595-
'sources': [
596-
'src/large_pages/node_text_start.S'
597-
]
598-
}],
599-
]
600-
},
601581
{
602582
'target_name': '<(node_core_target_name)',
603583
'type': 'executable',
@@ -769,14 +749,6 @@
769749
},
770750
},
771751
}],
772-
[ 'OS in "linux freebsd openharmony" and '
773-
'target_arch=="x64"', {
774-
'dependencies': [ 'node_text_start' ],
775-
'ldflags+': [
776-
'<(obj_dir)/<(node_text_start_object_path)'
777-
]
778-
}],
779-
780752
['node_fipsinstall=="true"', {
781753
'variables': {
782754
'openssl-cli': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)openssl-cli<(EXECUTABLE_SUFFIX)',
@@ -1013,11 +985,6 @@
1013985
'HAVE_DTLS=1',
1014986
],
1015987
}],
1016-
[ 'OS in "linux freebsd mac solaris openharmony" and '
1017-
'target_arch=="x64" and '
1018-
'node_target_type=="executable"', {
1019-
'defines': [ 'NODE_ENABLE_LARGE_CODE_PAGES=1' ],
1020-
}],
1021988
[ 'use_openssl_def==1', {
1022989
# TODO(bnoordhuis) Make all platforms export the same list of symbols.
1023990
# Teach mkssldef.py to generate linker maps that UNIX linkers understand.

src/debug_utils.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ void NODE_EXTERN_PRIVATE FWrite(FILE* file, const std::string& str);
4949
V(COMPILE_CACHE) \
5050
V(CONTEXTIFY) \
5151
V(DIAGNOSTICS) \
52-
V(HUGEPAGES) \
5352
V(INSPECTOR_SERVER) \
5453
V(INSPECTOR_CLIENT) \
5554
V(INSPECTOR_PROFILER) \

0 commit comments

Comments
 (0)