Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0a76c7e
Initial Large Page (2M) support for node.js
suresh-srinivas Mar 23, 2018
fa0e324
Add support for checking if explicitHugePages and transparentHugePage…
suresh-srinivas Mar 26, 2018
fdb45cd
Added License headers
suresh-srinivas Mar 30, 2018
b7791c2
Get rid of waring messages & code cleanup
suresh-srinivas Mar 30, 2018
6631eea
Protect the large pages under #ifdef NODE_ENABLE_LARGE_CODE_PAGES and…
suresh-srinivas Apr 4, 2018
843089c
Added configure option to enable huge pages
uttampawar Apr 9, 2018
077bc01
Added else clause to set node_use_large_pages=false by default
uttampawar Apr 9, 2018
7bdd9fc
Merge branch 'configure_fixes' into 2M-Pages-For-Code-16198
uttampawar Apr 9, 2018
b91de5a
Finished adding checks at appropriate places to handle possible error…
uttampawar May 8, 2018
7ef956a
Changed return type for two function from void to int
uttampawar May 9, 2018
b02e7a9
Fixed lint errors.
uttampawar May 24, 2018
2af82b1
Added one more condition check for verify the start address of newly …
uttampawar May 26, 2018
cae9285
Fixed syntax error due to wring data type. int64 to int64_t
uttampawar May 30, 2018
30114b6
Removed explictHugePages code
suresh-srinivas May 30, 2018
39e1f0d
Merge branch 'add-checks' into 2M-Pages-For-Code-16198
suresh-srinivas May 30, 2018
49cd0de
Merge branch '2M-Pages-For-Code-16198' of https://github.intel.com/DS…
suresh-srinivas May 30, 2018
2dd9e8c
Added Large Page Support
suresh-srinivas May 30, 2018
51d0f02
Merge branch 'intel-large-pages' of https://github.com/suresh-sriniva…
suresh-srinivas May 31, 2018
2f672ee
Update PR based on feedback
suresh-srinivas Jun 1, 2018
31504cc
Addressing the additional PR feedback
suresh-srinivas Jun 3, 2018
f998c58
Fix the gypi style issue
suresh-srinivas Jun 3, 2018
9f15cfc
Update with stylistic changes (eg char* instead of char *, IsLargePag…
suresh-srinivas Jun 4, 2018
d6de361
Add additional guard so large pages is only under Linux and target_ar…
suresh-srinivas Jun 4, 2018
29c7d13
Style fixes according to the Node C++ Style Guide
suresh-srinivas Jun 4, 2018
9828036
Eliminate ld.script and use implicit script
suresh-srinivas Jun 7, 2018
600cf54
Add #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
suresh-srinivas Jun 7, 2018
bf259e2
Fix the test failures
suresh-srinivas Jun 7, 2018
f0a6dcb
Add detailed help message to configure --with-largepages
suresh-srinivas Jun 8, 2018
4610793
Fix style issues and created inline functions instead of macros for a…
suresh-srinivas Jun 12, 2018
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
Added License headers
Increased number of Pages to be mapped
  • Loading branch information
suresh-srinivas committed Mar 30, 2018
commit fdb45cd3fcc2989bec11fa2c024720a71f07205e
29 changes: 27 additions & 2 deletions src/node_large_page.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
Copyright (C) 2018 Intel Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.

SPDX-License-Identifier: MIT
*/

#include <errno.h>
#include <fcntl.h> // _O_RDWR
#include <limits.h> // PATH_MAX
Expand All @@ -17,7 +41,7 @@
/*
The functions in this file map the text segment of node into 2M pages.
The algorithm is quite simple
1. Find the text region of node in memory
1. Find the text region of node binary in memory
2. Move the text region to large pages
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worthwhile to expand the algorithm a bit more - helps later maintainance.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure that sounds good. I will add more details.

Expand Down Expand Up @@ -114,8 +138,9 @@ namespace node {
// end = (unsigned int long) &__etext;
// start = 0x0842700;
// end = 0x1679e19;
// fprintf(stderr, "find_node_text_region start-end: %lx-%lx nodestart-nodeend %lx-%lx\n", start, end, (unsigned int long)&__nodetext, (unsigned int long) &__etext);
start = (unsigned int long) &__nodetext;
end = (unsigned int long) &__etext;
// end = (unsigned int long) &__etext;
char *from = (char *)PAGE_ALIGN_UP(start, hugePageSize);
char *to = (char *)PAGE_ALIGN_DOWN(end, hugePageSize);
// fprintf(stderr, "find_node_text_region %lx-%lx %s\n", from, to, name);
Expand Down
27 changes: 26 additions & 1 deletion src/node_large_page.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
/*
Copyright (C) 2018 Intel Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.

SPDX-License-Identifier: MIT
*/

#ifndef NODE_LARGEPAGE_H_
#define NODE_LARGEPAGE_H_

namespace node {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be enclosed in

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks I fixed it.

namespace largepages {
void map_static_code_to_large_pages();
bool isLargePagesEnabled();
void map_static_code_to_large_pages();
} // namespace largepages
} // namespace node

Expand Down