Kernel option: SWAP

James Wilkinson james at westexe.demon.co.uk
Tue Sep 7 12:28:22 UTC 2004


Juan L. Pastor wrote:
> I want to increase my knowledge about the options we can choose when
> recompiling the kernel. I have already encountered some doubts just
> starting:
> 
> Support for paging of anonymous memory (swap) (SWAP)
> 
> This option allows you to choose whether you want to have support
> for socalled swap devices or swap files in your kernel that are
> used to provide more virtual memory than the actual RAM present
> in your computer. If unsure say Y.
> 
> What king of swap devices or files makes this option reference to?

You almost certainly have some now. Look at the contents of /proc/swaps:
it will tell you which devices (which will begin with /dev/) or files
you have configured.

Briefly, paging space ("swap" used to mean something different: what
Linux uses is paging space) is space on the hard drive for the memory
manager to use. If there's a lot of data in memory, it can push the
least-used "pages" of memory out to paging space and re-use the physical
memory. This means that the computer can act as though it has more
memory than it really has.

This is the same for Linux, Windows, commercial Unix, MacOS, and the
BSDs. Linux can use raw devices (partitions on the hard drive) for swap,
and this is more efficient than files, but either will work.

> I get
> the following error recompiling if I disable it:

Not sure. The kernel.org "vanilla" kernel is supposed to work without
swap (although that's not necessarily a good idea): it looks like you're
using Fedora sources, and they might need swap compiled in.

> I thought that defining the swap filesystem and mounting it with swapon
> was enough.

Well, yes, but only if the kernel actually supports swap!

I'm afraid the phrase "Well Don't Do That Then" comes to mind.

James.

-- 
E-mail address: james | Never ask, "Oh, why were things so much better
@westexe.demon.co.uk  | in the old days?"
                      | It's not an intelligent question.
                      |     -- Ecclesiastes 7 v. 10





More information about the users mailing list