Re: Forget fragmentation (was Re: Linux hostile to poverty)

Linus Torvalds (torvalds@transmeta.com)
18 Jul 1998 20:39:50 GMT


In article <6oquk3$7c5$1@palladium.transmeta.com>,
Linus Torvalds <torvalds@transmeta.com> wrote:
>
>Some of the behaviour you can tune at run-time, and that may actually be
>a big thing already. In particular, check out the /proc/sys/vm/freepages
>file: it contains three numbers that essentially specify how much memory
>the machine tries to keep free.. You can tweak the numbers a bit to see
>how that changes the behaviour of your system..

In fact, if you're running on a 8MB machine, I think this file defaults
to

48 96 144

or something like that.. The numbers mean (in order)
- what point where we're so low on memory that anybody who allocates
more memory has to try to free some memory before he is allowed to
allocate (ie "if the system has less than 48 pages free, before you
allocate a page you'd better try to free some other page up")
- the point where "kswapd" starts to consider us to be low on memory
(ie "if we have less than 96 pages free, we'd better start paging
things out really aggressively")
- the point where "kswapd" starts to think that we have "enough" memory
(ie "if we have more than 144 pages, we don't have to worry about
memory any more").

(The area between 95 and 144 pages free is a "low-high water mark" area,
where we allow memory to go down to 96 pages, but once it has done that
we try to make it go up to 144 pages again).

Now, I suspect that those defaults are too big for a 8MB system. They
essentially mean that we always try to keep half a megabyte of memory
free, which is a pretty big chunk once the kernel and the reserved pages
have been taken out of the system.

People that have 8MB machines, could you please check out what happens
when you do a

echo "20 40 60" > /proc/sys/vm/freepages

and whether that is a better default for small machines?

(NOTE! Only do this on a 2.1.109 kernel - earlier 2.1.x kernels had
slightly different behaviour and meaning for the numbers, and I'm not
interested in hearing what those kernels do ;)

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html