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

NixOS: increase default value of vm.max_map_count #238412

Closed
SuperSamus opened this issue Jun 18, 2023 · 4 comments · Fixed by #238459
Closed

NixOS: increase default value of vm.max_map_count #238412

SuperSamus opened this issue Jun 18, 2023 · 4 comments · Fixed by #238459

Comments

@SuperSamus
Copy link
Contributor

SuperSamus commented Jun 18, 2023

Describe the bug

Applications are starting to allocate more times than allowed by the default value of vm.max_map_count, 65530.

For instance, this situation arises in applications such as Ryujinx (Ryujinx/Ryujinx#4702) and newer Windows games like Hogwarts Legacy (HansKristian-Work/vkd3d-proton#1420).

SteamOS has already addressed this matter by augmenting the aforementioned value, while Fedora intends to implement the same modification in Fedora 39 (https://www.phoronix.com/news/Fedora-39-Max-Map-Count-Approve, https://fedoraproject.org/wiki/Changes/IncreaseVmMaxMapCount).

@RaitoBezarius
Copy link
Member

Please feel free to send PRs, it's hard to track those issues as you don't mention any owner.

@SuperSamus
Copy link
Contributor Author

The line to add is:

boot.kernel.sysctl."vm.max_map_count" = mkDefault n;

The questions are:

  • How big should n be? 2147483642? 1048576?
  • In which file should I add it? At the bottom of nixos/modules/config/sysctl.nix?

@RaitoBezarius
Copy link
Member

The line to add is:

boot.kernel.sysctl."vm.max_map_count" = mkDefault n;

The questions are:

  • How big should n be? 2147483642? 1048576?
  • In which file should I add it? At the bottom of nixos/modules/config/sysctl.nix?

You mentioned other distros were thinking about bumping it, let's follow Fedora lead

In the relevant file, a quick grep shows indeed that sysctl is one of the best candidate. :)

@yu-re-ka
Copy link
Contributor

yu-re-ka commented Jun 18, 2023

For the policy discussion: I'm all in favor of doing this soon(m). It is not really dangerous and as people have explained to me the previous default has been there for historical reasons and 32 bit systems.

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

Successfully merging a pull request may close this issue.

4 participants