-
Notifications
You must be signed in to change notification settings - Fork 12
Description
As far as I can tell, Swapspace does not currently set priorities for its swapfiles. This means that the kernel swaps evenly across all of Swapspace's swapfiles; this has a significant downside in that, when deallocation happens, much more swap is released into RAM than is necessary. If instead each successive swapfile had a priority one lower than the file before it, the kernel would fill up older swapfiles before using newer ones; this significantly reduces the impacts of deallocating the largest swapfile, and better-aligns with user expectations. See here for an update on this struck-through portion.
What value is best for the default priority is debatable.
- The max is
32767, but we should leave room to allow for swap devices external to Swapspace (like a swap partition, which many distros create during installation, and which users may be stuck with when they start using Swapspace). - The default is to use the highest available negative number, which should only be used for hibernation swapfiles.
- The minimum configurable value is
0, so we should target a Swapspace min of0.
If we are only creating up to the 32 swap devices the kernel permits, then having the default priority be 31 will maximize economy.
If this is implemented, then #45 will need to become priority-aware.