在安装大多数(如果不是全部)发行版的Linux期间,默认情况下会将硬盘驱动器分区为包括交换分区。
可以通过以下方式更改此行为 swapon -p priority
根据手册页,优先级是:
PRIORITY
Each swap area has a priority, either high or low. The default priority is
low. Within the low-priority areas, newer areas are even lower priority
than older areas.
All priorities set with swapflags are high-priority, higher than default.
They may have any non-negative value chosen by the caller. Higher numbers
mean higher priority.
Swap pages are allocated from areas in priority order, highest priority
first. For areas with different priorities, a higher-priority area is
exhausted before using a lower-priority area. If two or more areas have the
same priority, and it is the highest priority available, pages are
allocated on a round-robin basis between them.
As of Linux 1.3.6, the kernel usually follows these rules, but there are
exceptions
为什么您需要多个交换文件?
系统管理员配置多个交换是否是惯例?