re: [announce] swap mini-howto (updated)

Shane Shrybman (shrybman@sympatico.ca)
05 Nov 2002 11:07:32 -0500


Hi Randy,

I thought that it might be possible that the folks who might need this
swap mini-howto might not be the folks who understand terms like "memory
pressure" and "dirty" memory. Have a look at the below and use or don't
use whatever you want. I also included a bit on features and a little
more on priorities.

I also am curious about this sentence:

"Block size in swap space is assumed to be the CPU architecture's
page size."

What should a user be aware of with regard to this info?

Introduction

Linux uses swap space as "extra" or "virtual" memory. When most of
the system's real memory is in use, and there is a need for more,
some data will be moved into swap to free real RAM memory for use by
applications. This is called swapping out. When the data that is
in swap needs to be used it is swapped back in from swap space. The
rate at which data is swapped to and from one or more swap spaces
can be monitored with the vmstat command's swap-in (si) and swap-out
(so) columns.

Linux kernel code and data is not swappable and is never moved to swap.
User code never needs to be written to swap space because it already
exists on disk and can be read in from there if it is required again.
User data can be written to swap space and read back in when needed.

Features

Managing swap with Linux is very easy and flexible compared to most of
proprietary operating systems. Linux's swap spaces can be turned on and
off without a reboot and even while they are in use!

Logical Volumes can be used as swap devices.

Version 0 swap space format is no longer supported in 2.5+.

Swap spaces can be given different priorities, (man 2 swapon) that
determine how the swap spaces will be used. Higher priority swap spaces
will be exhausted first and swap spaces with equal priorities will be
striped. The Priority can be specified at swap space activation with
the swapon command or in the /etc/fstab file.

/dev/hda2 none swap pri=5,defaults 0 0
/dev/hde2 none swap pri=5,defaults 0 0

Regards,

Shane

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/