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

fix(noise): only change hugepage state if needed #90

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

noelmcloughlin
Copy link
Member

@noelmcloughlin noelmcloughlin commented Jan 20, 2021

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

What type of PR is this?

Primary type

  • [build] Changes related to the build system
  • [chore] Changes to the build process or auxiliary tools and libraries such as documentation generation
  • [ci] Changes to the continuous integration configuration
  • [feat] A new feature
  • [fix] A bug fix
  • [perf] A code change that improves performance
  • [refactor] A code change that neither fixes a bug nor adds a feature
  • [revert] A change used to revert a previous commit
  • [style] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)

Secondary type

  • [docs] Documentation changes
  • [test] Adding missing or correcting existing tests

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

#89

Describe the changes you're proposing

Enable hugepages only when needed, not everytime

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

  • Updated the README (e.g. Available states).
  • Updated pillar.example.

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
  • Updated the relevant test pillar.

Additional context

@iaingeorgeson
Copy link

Thanks for taking a look at this.

Unfortunately, I don't think this commit solves the problem. This file is on sysfs, The command changes the state rather than creating it, and the current state is marked in its contents with square brackets:

always madvise [never]

So the test would be something like:

- unless: grep -q '[never]' /sys/kernel/mm/transparent_hugepage/enabled

@noelmcloughlin
Copy link
Member Author

i checked https://redis.io/topics/latency and you are correct.
We can assume Redis formula should enforce never.
I'll update the commit.

The ideal solution is probably to create a service file (https://docs.mongodb.com/manual/tutorial/transparent-huge-pages) but you could open separate issue for that and someone will get around to it sometime.

@noelmcloughlin
Copy link
Member Author

noelmcloughlin commented Jan 20, 2021

$ echo never >/tmp/dave
$ grep -ir '^never' /tmp/dave
never
$ echo $?
0
$ echo always >/tmp/dave
$ grep -ir '^never' /tmp/dave
$ echo $?
1

@iaingeorgeson
Copy link

# echo never >/sys/kernel/mm/transparent_hugepage/enabled
# grep -ir '^never' /sys/kernel/mm/transparent_hugepage/enabled
# echo $?
1
# echo always >/sys/kernel/mm/transparent_hugepage/enabled
# grep -ir '^never' /sys/kernel/mm/transparent_hugepage/enabled
# echo $?
1

@noelmcloughlin noelmcloughlin merged commit af51411 into saltstack-formulas:master Mar 4, 2021
@noelmcloughlin noelmcloughlin deleted the huge branch March 4, 2021 13:21
@saltstack-formulas-travis

🎉 This PR is included in version 0.27.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants