Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v12.x] Backport large pages asm to v12.x #32092

Commits on Apr 9, 2020

  1. src: make --use-largepages a runtime option

    Moves the option that instructs Node.js to-remap its static code to
    large pages from a configure-time option to a runtime option. This
    should make it easy to assess the performance impact of such a change
    without having to custom-build.
    
    PR-URL: nodejs#30954
    Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
    Reviewed-By: David Carlier <devnexen@gmail.com>
    Reviewed-By: David Carlier <devnexen@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
    Reviewed-By: Denys Otrishko <shishugi@gmail.com>
    Co-authored-by: David Carlier <devnexen@gmail.com>
    Gabriel Schulhof and devnexen committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    02ea3b0 View commit details
    Browse the repository at this point in the history
  2. build: re-introduce --use-largepages as no-op

    Re-introduce the build-time option as a no-op in order to retain
    backward compatibility for LTS purposes.
    
    Re: nodejs#31063 (review)
    PR_URL: nodejs#31075
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Richard Lau <riclau@uk.ibm.com>
    Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Gabriel Schulhof committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    db8f1b0 View commit details
    Browse the repository at this point in the history
  3. build: switch realpath to pwd

    PR-URL: nodejs#31095
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    bcoe authored and Gabriel Schulhof committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    17fa34c View commit details
    Browse the repository at this point in the history
  4. src: make large_pages node.cc include conditional

    The usage of the relevant methods from the file is conditional so make
    the include conditional too.
    
    PR-URL: nodejs#31078
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Richard Lau <riclau@uk.ibm.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: David Carlier <devnexen@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    lundibundi authored and Gabriel Schulhof committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    58ab4b5 View commit details
    Browse the repository at this point in the history
  5. build: warn upon --use-largepages config option

    Emit a warning when the user configures with `--use-largepages` and/or
    `--use-largepages-script-lld` informing them that the option is now
    available as a Node.js runtime option once it is built.
    
    Refs: nodejs#31063 (comment)
    PR-URL: nodejs#31103
    Reviewed-By: Richard Lau <riclau@uk.ibm.com>
    Reviewed-By: Denys Otrishko <shishugi@gmail.com>
    Gabriel Schulhof committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    d8bdf4e View commit details
    Browse the repository at this point in the history
  6. src: use __executable_start for linux hugepages

    `__executable_start` is provided by GNU's and LLVM's default linker
    scripts, obviating the need to plug in a custom linker script.
    
    The problem with our bespoke linker script is that it works with ld.bfd
    but not ld.gold and cannot easily be ported because the latter linker
    doesn't understand the `INSERT BEFORE` directive.
    
    The /proc/self/maps scanner is updated to account for the fact that
    there are a number of sections between `&__executable_start` and
    the start of the .text section.
    
    Fortunately, those sections are all mapped into the same memory segment
    so we only need to look at the next line to find the start of our text
    segment.
    
    Fixes: nodejs#31520
    
    PR-URL: nodejs#31547
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Gus Caplan <me@gus.host>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: David Carlier <devnexen@gmail.com>
    bnoordhuis authored and Gabriel Schulhof committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    ccadc89 View commit details
    Browse the repository at this point in the history
  7. src: include large pages source unconditionally

    Restrict the usage of the C preprocessor directive enabling large
    pages support to the large pages implementation. This cleans up the
    code in src/node.cc.
    
    PR-URL: nodejs#31904
    Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
    Reviewed-By: David Carlier <devnexen@gmail.com>
    Reviewed-By: Denys Otrishko <shishugi@gmail.com>
    Gabriel Schulhof committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    2f3d446 View commit details
    Browse the repository at this point in the history
  8. src: start the .text section with an asm symbol

    We create an object file in assembly which introduces the symbol
    `__node_text_start` into the .text section and place the resulting
    object file as the first file the linker encounters. We do this to
    ensure that we can recognize the boundaries of the .text section when
    attempting to establish the address range to map to large pages.
    
    Additionally, we rename the section containing the remapping code from
    `.lpstub` to `lpstub` so as to take advantage of the linker's feature
    whereby it inserts the symbol `__start_lpstub` when the section's name
    can be rendered as a valid C variable. We need this symbol in order to
    avoid self-mapping the remapping code to large pages, because doing so
    would cause the process to crash.
    
    PR-URL: nodejs#31981
    Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
    Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: David Carlier <devnexen@gmail.com>
    Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
    Gabriel Schulhof committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    f2572a1 View commit details
    Browse the repository at this point in the history
  9. build: fix building with ninja

    The ninja build places objects in a different directory.
    
    Co-authored-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
    Signed-off-by: Richard Lau <riclau@uk.ibm.com>
    
    PR-URL: nodejs#32071
    Reviewed-By: Matheus Marchini <mat@mmarchini.me>
    Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
    Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
    Reviewed-By: Shelley Vohr <codebytere@gmail.com>
    Reviewed-By: Myles Borins <myles.borins@gmail.com>
    Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
    richardlau authored and Gabriel Schulhof committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    0c391fb View commit details
    Browse the repository at this point in the history