Re: Linux version 2.2.5 memory management

Stephen C. Tweedie (sct@redhat.com)
Wed, 21 Apr 1999 16:13:29 +0100 (BST)


Hi,

On Sat, 17 Apr 1999 20:04:19 -0400 (EDT), "Richard B. Johnson"
<root@chaos.analogic.com> said:

> Whether or not this is appropriate is another matter. I acquire pages
> until the 'low_on_memory' flag is true. If I acquire pages until the
> return value is NULL, the machine will hang forever with processes being
> killed off including init.

"low_on_memory" is purely an internal variable within the swapper. Its
only purpose in life is to add some hysteresis to the swapper so that we
are not constantly calling for tiny bits of work just because we've
stepped one page over the initial free-page threshold. Using it in
any other context is wrong.

To check for true free pages in the system, you should be querying
nr_free_pages, the total count of physically free pages in the system.

> I believe that there is something very wrong with the heuistics in
> returning free pages to the free list.

Free pages are always on the free list. That is what defines a free
page! A free page not on the free list is lost forever.

Then, on Sat, 17 Apr 1999 22:06:42 -0400 (EDT), "Richard B. Johnson"
<root@chaos.analogic.com> said:

> On Sun, 18 Apr 1999, Andrea Arcangeli wrote:
>> Could you add:
>> b_state = 0;
>> in bforget (buffer.c)?

> Yep! This plugs a major hole. It now makes the system usable.

If this makes any difference at all then you are not just grabbing and
releasing free pages! That change can only have an effect if you are
using fs buffers. Free list management for buffers and cache pages is
completely different from the physical free list management. It would
be useful to know what you are actually doing here.

Cheers,
Stephen

-
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.tux.org/lkml/