mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
nixos/boot/tmp: introduce adaptive huge memory pages (#404514)
This commit is contained in:
commit
9da9474d63
1 changed files with 18 additions and 0 deletions
|
@ -31,6 +31,23 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tmpfsHugeMemoryPages = lib.mkOption {
|
||||||
|
type = lib.types.enum [
|
||||||
|
"never"
|
||||||
|
"always"
|
||||||
|
"within_size"
|
||||||
|
"advise"
|
||||||
|
];
|
||||||
|
default = "never";
|
||||||
|
example = "within_size";
|
||||||
|
description = ''
|
||||||
|
never - Do not allocate huge memory pages. This is the default.
|
||||||
|
always - Attempt to allocate huge memory page every time a new page is needed.
|
||||||
|
within_size - Only allocate huge memory pages if it will be fully within i_size. Also respect madvise(2) hints. Recommended.
|
||||||
|
advise - Only allocate huge memory pages if requested with madvise(2).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
useTmpfs = lib.mkOption {
|
useTmpfs = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
@ -60,6 +77,7 @@ in
|
||||||
"nosuid"
|
"nosuid"
|
||||||
"nodev"
|
"nodev"
|
||||||
"size=${toString cfg.tmpfsSize}"
|
"size=${toString cfg.tmpfsSize}"
|
||||||
|
"huge=${cfg.tmpfsHugeMemoryPages}"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue