From: torvalds@klaava.Helsinki.FI (Linus Torvalds) Subject: Re: Big swap partitions [> 16M] Date: Fri, 16 Apr 1993 07:26:47 GMT
In article <1993Apr16.025655.10225@news.acns.nwu.edu> hpa@nwu.edu (H. Peter Anvin) writes:
>
>How about getting larger than 16 Mb partitions? Is that also just to
>change one (or more) #define's? I can't think of anyone who would
>need more than, say, 16 swap areas, but larger than 16 Mb seems to be
>a common desire. How about changing 127x16 Mb to, say, 15x128 Mb?
The problem isn't the swap-page encoding (the encoding will allow
127x128MB happily), but due to my lazyness. A swap area needs a "swap
page counter array", where each page (4kB) uses one byte as a counter
that tells how many different processes use the page. And due to the
normal linux memory management routines, it's hard to allocate an array
bigger than one page - thus you get a maximum swap area of 4096 pages
which is 16MB..
The coding necessary to use several pages for swap counters isn't
overwhelming: in fact I have already gotten one patch for it (sorry to
have forgotten the name of the person who sent it to me), and the only
reason I didn't use it was that I'm a bit nervous about the memory
management, so I either want to do it myself or be *very* sure there are
no problems with the patch..
So the current 16MB limit isn't anything fundamental (unless you call my
lazyness that), and one day you'll wake up and notice that linux
automatically takes advantage of more than 16MB of swap. The only
problem now is "when?", and I can't say.
Linus