I need expert knowledge on new flag for swapon(2)

Michael Elizabeth Chastain (mec@duracef.shout.net)
Fri, 7 Jul 1995 09:27:39 -0500


I'm revising the manual page for 'swapon(2)' to document the new
priority flag.

Here's my new text, which describes what I see in Linux 1.3.6 source
code. I'd appreciate your comments so that my man page is accurate and
useful.

I care only about what 'swapon(2)' actually -does- do in 1.3.6 or more
recent kernels. I don't want to start a debate about what 'swapon(2)'
-should- do.

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.o

All priorities set with -swapflags- are high-priority,
higher than default. They may have any non-negative
value chosen by the caller.

Swap pages are allocated in priority order. For areas
with different priority, each area is exhausted before
using the next area. If two or more areas have the same
priority, and it is the highest available priority,
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.

Michael Chastain
mec@duracef.shout.net