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

Re: FAQ... Swap partition... how big?



>>>>> "WK" == WK Yeung <kit@kitkit.net> writes:

    WK> Yes, I agree. According to my memory, Linux's swap should not more
    WK> than 128MB or it is wasted, it is limited by some constrains I can't
    WK> remember, try to search for it in newsgroup.

I no longer hold: from the man page of mkswap(8):

       Linux knows about two styles of swap areas, old style  and
       new  style.   The  last  10 bytes of the first page of the
       swap area distinguishes them: old style has  `SWAP_SPACE',
       new style has `SWAPSPACE2' as signature.

       In  the  old  style, the rest of this first page was a bit
       map, with a 1 bit for each usable page of the  swap  area.
       Since  the first page holds this bit map, the first bit is
       0.  Also, the last 10 bytes hold the signature. So, if the
       page  size  is  S,  an old style swap area can describe at
       most 8*(S-10)-1 pages used for swapping.  With S=4096  (as
       on  i386),  the  useful  area  is  at most 133890048 bytes
       (almost 128 MiB), and the rest is wasted.  On an alpha and
       sparc64, with S=8192, the useful area is at most 535560992
       bytes (almost 512 MiB).

       The old setup wastes most of  this  bitmap  page,  because
       zero  bits denote bad blocks or blocks past the end of the
       swap space, and a simple integer suffices to indicate  the
       size  of the swap space, while the bad blocks, if any, can
       simply be listed. Nobody wants to use a  swap  space  with
       hundreds of bad blocks. (I would not even use a swap space
       with 1 bad block.)  In the new style  swap  area  this  is
       precisely what is done.  The maximum useful size of a swap
       area now depends on the architecture.  It is roughly  2GiB
       on  i386,  PPC,  m68k, ARM, 1GiB on sparc, 512MiB on mips,
       128GiB on alpha and 3TiB on sparc64.

Regards,
Isaac.
-- 
| This message was re-posted from debian-chinese-big5@lists.debian.org
| and converted from big5 to gb2312 by an automatic gateway.

Attachment: pgp0AQ3Bd3LUz.pgp
Description: PGP signature


Reply to: