Title: Future of `--use-largepages=on` · Issue #64408 · nodejs/node · GitHub
Open Graph Title: Future of `--use-largepages=on` · Issue #64408 · nodejs/node
X Title: Future of `--use-largepages=on` · Issue #64408 · nodejs/node
Description: This was added back in 2018, some background can be found in this issue #16198 - from what I can tell we opted into a user-land relocation to work around the fact that for most kernels in the wild, file-backed .text THP won't work out of...
Open Graph Description: This was added back in 2018, some background can be found in this issue #16198 - from what I can tell we opted into a user-land relocation to work around the fact that for most kernels in the wild,...
X Description: This was added back in 2018, some background can be found in this issue #16198 - from what I can tell we opted into a user-land relocation to work around the fact that for most kernels in the wild,...
Opengraph URL: https://github.com/nodejs/node/issues/64408
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Future of `--use-largepages=on`","articleBody":"This was added back in 2018, some background can be found in this issue https://github.com/nodejs/node/issues/16198 - from what I can tell we opted into a user-land relocation to work around the fact that for most kernels in the wild, file-backed .text THP won't work out of the box (i.e. `CONFIG_READ_ONLY_THP_FOR_FS` still isn't on in the mainstream distros most commonly deployed even in 2026, also it is [being removed](https://lwn.net/Articles/1070484/), there [are some alternatives though](https://lwn.net/Articles/1066582/))\n\nCurrently the `--use-largepages` implementation incurs two problems:\n\n1. It breaks the Node.js binary on WSL1 https://github.com/nodejs/node/issues/63735\n2. It will stop working in Node.js after we roll in https://chromium-review.googlesource.com/c/v8/v8/+/7985687\n\n2 would be tricky to deal with, it's an optimization that removed the `/proc/self/maps` parsing overhead and simply rely on address equality of the embedded blob to detect whether it's file-backed, the current method `--use-largepages` uses to relocate the text region doesn't change the address equality even though the blob is no longer file-backed after relocation, hence it will crash because `MREMAP_DONTUNMAP` will zero out non-file-backed memory.\n\nFrom what I can think of we have a few choices:\n\n1. Convince the upstream to handle the case when the embedded blob is address-equal to the default blob, but is not actually file-backed. From what I can think of this can only be implemented by re-introducing some file parsing overhead (e.g. at least `/proc/self/pagemap`) to the isolate group initialization process, defeating the optimization added in that CL.\n2. Add a flag to V8 to enforce checking the blob is file-backed via more robust measures other than address equality, then on the Node.js side, enable that flag when `--use-largepages=on`\n3. Reimplement `--use-largepages=on` by relocating the `.text` to memory backed by memfd instead of an anonymous memory, then `MREMAP_DONTUNMAP` won't zero out the memory\n\nI think 2 and 3 are probably more viable/have less downsides. But since so far it doesn't look like `--use-largepages=on` is used a lot in the wild, and the alignment in the build it needs breaks WSL1, it also raises another question: do we even want to keep maintaining it? So there's also option 4:\n\n4. Make `--use-largepages=on` a no-op (it can already be a no-op because `MADV_HUGEPAGE` is only advisory, so the feature only ever works on a best-effort basis), and deprecate it eventually.\n\nOpening an issue to see if there's any usage of this feature or if there are other ideas to deal with this. If there are real-world users of this feature it may still be worth it to do 2 or 3, but if there are none, we are probably better off deprecating it to cut the maintenance burden (that is not to say to completely say goodbye to work in this line once and for all, but it should be experimented differently other than an opt-in flag that nobody seems to be deploying).","author":{"url":"https://github.com/joyeecheung","@type":"Person","name":"joyeecheung"},"datePublished":"2026-07-10T12:18:27Z","url":"https://github.com/nodejs/node/issues/64408"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4a2cdd31-501b-2c29-ca84-9f6b0d0bba02 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DE08:1587FA:79A2CB:A23666:6AED269F |
| html-safe-nonce | d919ad5367169c09af605fdcd1ee974fb7c0f131fbef3cfc493c5f83064bd9b8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTA4OjE1ODdGQTo3OUEyQ0I6QTIzNjY2OjZBRUQyNjlGIiwidmlzaXRvcl9pZCI6IjYzNTY4OTg2NjMyOTYyMTQ2ODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 15aacf4bfae6eed34414921e89394f5a8edd859a1928a105fb48d9244ca0dcb2 |
| hovercard-subject-tag | issue:4854906762 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/64408/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d5269b376b1a55ad2727b9aa20ba90782d17bb3f4dfd650960d37eed0303e2df/nodejs/node/issues/64408 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d5269b376b1a55ad2727b9aa20ba90782d17bb3f4dfd650960d37eed0303e2df/nodejs/node/issues/64408 |
| og:image:alt | This was added back in 2018, some background can be found in this issue #16198 - from what I can tell we opted into a user-land relocation to work around the fact that for most kernels in the wild,... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | joyeecheung |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 98b41fa4b5635ceb45a4c54320fced73817ff290 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width