nixos/boot/tmp: introduce adaptive huge memory pages

Changed files
+18
nixos
modules
system
boot
+18
nixos/modules/system/boot/tmp.nix
···
'';
};
useTmpfs = lib.mkOption {
type = lib.types.bool;
default = false;
···
"nosuid"
"nodev"
"size=${toString cfg.tmpfsSize}"
];
}
];
···
'';
};
+
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 {
type = lib.types.bool;
default = false;
···
"nosuid"
"nodev"
"size=${toString cfg.tmpfsSize}"
+
"huge=${cfg.tmpfsHugeMemoryPages}"
];
}
];