[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: swap priorities

Glenn McGrath <Glenn.McGrath@jcu.edu.au> writes:

> Im a bit confused.
> I just created two swap files with the boot floppies, the first swap
> file (28MB) has priority -1, and the second swap file i made (64MB) has
> a priority -2.
> On my systems i currently have 4 swap files (4 drives) and as i
> understoop making them the same priority enabled the kernel to use them
> in parallel (raid like). I assigned mine all priority of 1.
> I looked at man swapon and it says the priority can be anything between
> 0 and 32767.
> So two questions
> 1) Should the swap priorities be a positive value.

Hmm, according to the manpage it must be positive.

> 2) Should the priorities of multiple swap files be the same.

If you have 4 equally fast harddrives that don´t slowdown each other
you should give them all the same priority. If one is slower or slows
any other give that a lower priority. From "man 2 swapon":

       Swap  pages  are  allocated  from areas in priority order,
       highest priority first.  For areas with different  priori­
       ties,  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.

If you have all partitions with the same priority they will be used
equally (roughly) and thus give a good speed.

May the Source be with you.

Reply to: