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

swap areas in linux



[...]

> 
> I think you can have up to 16 swap files, and I think swap files can be up
> to 16MB each, but I'm not sure.  I was unable to create a swap file in a
> IDE-based Multiple Drives (md) RAID-0 array, but YMMV.

In the linux faq there is item 7.11:

------------------------------------------------------------------------
Question 7.11.  How can I have more than 128Mb of swap ?

Use several swap partitions or swapfiles - Linux supports up to 16 swap
areas, each of up to 128Mb.

Very old kernels only supported swap area sizes up to 16Mb.
------------------------------------------------------------------------

The last line probably shows where the 16MB legend comes from.  If I
read the item right, the total number of swap partitions  and swap files
summed up should be at most 16.

In the manual page of mkswap I found that swap partitions _and_
files can have a number of 1KB blocks limited by

              MINCOUNT = 10 * PAGE_SIZE / 1024
              MAXCOUNT = (PAGE_SIZE - 10) * 8 * PAGE_SIZE / 1024

For x86, which uses 4096 byte pages, this means swap areas can be
between 40KB and 130752KB (127.6875MB) in size.

Then in the swapon(2) (note the _2_) manual page, it says that for
the swapon(const char *path, int swapflags) function the following
error is defined:

       EPERM   The user is  not  the  super-user,  or  more  than
               MAX_SWAPFILES (defined to be 8 in Linux 1.3.6) are
               in use.

This means that only 8 swap areas can be used if I understand it well.
It also implies that you can use more swap areas if you recompile your
kernel, and first edit /usr/src/linux/include/linux/swap.h to raise the
value of MAX_SWAPFILES.  If this is so simple, should it then perhaps
be configurable through "make xconfig" and friends?  Maybe it would be
a good idea to put the basic info (8 swap areas, either file or
partition, between 40KB and 130752KB each, references to related manual
pages) in a more accessible place, like a manual page called "swap" in
section 5 or 8.

Eric Meijer

-- 
 E.L. Meijer (tgakem@chem.tue.nl)          | tel. office +31 40 2472189
 Eindhoven Univ. of Technology             | tel. lab.   +31 40 2475032
 Lab. for Catalysis and Inorg. Chem. (TAK) | tel. fax    +31 40 2455054


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: