LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Swap files priority values (https://www.linuxquestions.org/questions/linux-server-73/swap-files-priority-values-807770/)

vikas027 05-14-2010 03:57 AM

Swap files priority values
 
Dear All,

As mentioned in "man swapon" priority value is between 0 and 32767. BUT usually if we add swap devices without giving the priority, their priorities are set as -2, -3, -4 and so on; values which does not fall between 0 and 32767.

Why is it so ? Any ideas ? However, I know we can change them through "swapon -p". But, if do not wish to do so, it uses -2, -3, -4 only. Like below,

Code:

[root@server ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/mapper/VolGroup00-LogVol01        partition      1310712 0      -1
/extraswap1                            file            524280  0      -4
/extraswap2                            file            262136  0      -2
/extraswap3                            file            131064  0      -3


thecarpy 05-14-2010 07:12 PM

From http://lists.debian.org/debian-user/.../msg01075.html

If you don't add a priority yourself, the kernel generates a number for you. And those numbers are negative.

The swapon() system call only lets you specify a number greater than 0. This means, those swap partitions where a priority is used are used in preference to the ones that have an automatic one.

vikas027 05-14-2010 11:24 PM

Thanks for the link and info thecarpy.


All times are GMT -5. The time now is 09:27 AM.