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

Read exactly two tokens from Linux transparent huge pages sysfs config #37065

Closed
wants to merge 20 commits into from
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5a07333
src: simplify kernel transparent_hugepage enabled flag check by remov…
jayaddison Jan 25, 2021
72082b9
src: inspect kernel transparent_hugepage flag values without assuming…
jayaddison Jan 26, 2021
53648a0
src: add an explicit default value for the 'enabled' bool variable
jayaddison Jan 26, 2021
a7fe193
src: extract GetTransparentHugePagesConfiguration function to read sy…
jayaddison Jan 26, 2021
72dd2f3
src: extract IsTransparentHugePagesEnabledViaConfiguration function t…
jayaddison Jan 26, 2021
519f212
src: refactor: return early when we discover that huge tables is enab…
jayaddison Jan 26, 2021
21ed800
src: apply lint fix: use left-leaning pointers
jayaddison Jan 26, 2021
03922c0
src: lint fixup: rename function to fit within column width constraint
jayaddison Jan 26, 2021
434e8b8
src: use single-line return statement for null-pointer condition
jayaddison Jan 26, 2021
49b35e9
Revert "src: use single-line return statement for null-pointer condit…
jayaddison Jan 27, 2021
24d4943
Revert "src: lint fixup: rename function to fit within column width c…
jayaddison Jan 27, 2021
250e013
Revert "src: apply lint fix: use left-leaning pointers"
jayaddison Jan 27, 2021
53d148d
Revert "src: refactor: return early when we discover that huge tables…
jayaddison Jan 27, 2021
759b809
Revert "src: extract IsTransparentHugePagesEnabledViaConfiguration fu…
jayaddison Jan 27, 2021
37bf5f9
Revert "src: extract GetTransparentHugePagesConfiguration function to…
jayaddison Jan 27, 2021
e299a65
Revert "src: add an explicit default value for the 'enabled' bool var…
jayaddison Jan 27, 2021
d00fce6
Revert "src: inspect kernel transparent_hugepage flag values without …
jayaddison Jan 27, 2021
e7f1cf0
src: add Linux huge memory enabled system flag file format reference
jayaddison Jan 27, 2021
572b34a
src: update documentation reference to use the source of truth
jayaddison Jan 28, 2021
239589b
src: nit: update documentation reference to link to the line that the…
jayaddison Jan 28, 2021
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
4 changes: 3 additions & 1 deletion src/large_pages/node_large_page.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ struct text_region FindNodeTextRegion() {
bool IsTransparentHugePagesEnabled() {
std::ifstream ifs;

// File format reference:
// https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/huge_memory.c?id=13391c60da3308ed9980de0168f74cce6c62ac1d#n163
ifs.open("/sys/kernel/mm/transparent_hugepage/enabled");
if (!ifs) {
PrintWarning("could not open /sys/kernel/mm/transparent_hugepage/enabled");
Expand All @@ -268,7 +270,7 @@ bool IsTransparentHugePagesEnabled() {

std::string always, madvise;
if (ifs.is_open()) {
while (ifs >> always >> madvise) {}
ifs >> always >> madvise;
}
ifs.close();

Expand Down