Skip to content

Commit 9d741c0

Browse files
joyeecheungaduh95
authored andcommitted
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 6d7428a commit 9d741c0

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
@@ -3477,19 +3477,21 @@ When both are set, `--use-env-proxy` takes precedence.
34773477
added:
34783478
- v13.6.0
34793479
- v12.17.0
3480+
changes:
3481+
- version: REPLACEME
3482+
pr-url: https://github.com/nodejs/node/pull/65389
3483+
description: This option is now a no-op.
34803484
-->
34813485

3482-
Re-map the Node.js static code to large memory pages at startup. If supported on
3483-
the target system, this will cause the Node.js static code to be moved onto 2
3484-
MiB pages instead of 4 KiB pages.
3486+
This option is no longer supported and a no-op. It used to re-map the Node.js
3487+
static code to large memory pages at startup.
34853488

3486-
The following values are valid for `mode`:
3489+
It still accepts the following values for compatibility:
34873490

34883491
* `off`: No mapping will be attempted. This is the default.
3489-
* `on`: If supported by the OS, mapping will be attempted. Failure to map will
3490-
be ignored and a message will be printed to standard error.
3491-
* `silent`: If supported by the OS, mapping will be attempted. Failure to map
3492-
will be ignored and will not be reported.
3492+
* `on`: No mapping will be attempted and a message will be printed to
3493+
standard error stating it's no longer supported.
3494+
* `silent`: Same as `off`.
34933495

34943496
### `--use-system-ca`
34953497

doc/node-config-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@
758758
},
759759
"use-largepages": {
760760
"type": "string",
761-
"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)"
761+
"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')."
762762
},
763763
"use-openssl-ca": {
764764
"type": "boolean",

doc/node.1

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,19 +1694,17 @@ This is equivalent to setting the \fBNODE_USE_ENV_PROXY=1\fR environment variabl
16941694
When both are set, \fB--use-env-proxy\fR takes precedence.
16951695
.
16961696
.It Fl -use-largepages Ns = Ns Ar mode
1697-
Re-map the Node.js static code to large memory pages at startup. If supported on
1698-
the target system, this will cause the Node.js static code to be moved onto 2
1699-
MiB pages instead of 4 KiB pages.
1700-
The following values are valid for \fBmode\fR:
1697+
This option is no longer supported and a no-op. It used to re-map the Node.js
1698+
static code to large memory pages at startup.
1699+
It still accepts the following values for compatibility:
17011700
.Bl -bullet
17021701
.It
17031702
\fBoff\fR: No mapping will be attempted. This is the default.
17041703
.It
1705-
\fBon\fR: If supported by the OS, mapping will be attempted. Failure to map will
1706-
be ignored and a message will be printed to standard error.
1704+
\fBon\fR: No mapping will be attempted and a message will be printed to
1705+
standard error stating it's no longer supported.
17071706
.It
1708-
\fBsilent\fR: If supported by the OS, mapping will be attempted. Failure to map
1709-
will be ignored and will not be reported.
1707+
\fBsilent\fR: Same as \fBoff\fR.
17101708
.El
17111709
.
17121710
.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)