public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: space-00002@vortex.physik.uni-konstanz.de
Cc: linux-kernel@vger.kernel.org
Subject: Re: buffer/memory strangeness in 2.4.16 / 2.4.17pre2
Date: Sat, 01 Dec 2001 20:43:20 -0800	[thread overview]
Message-ID: <3C09B168.401E61C9@zip.com.au> (raw)
In-Reply-To: <200111291201.fATC1pd04206@lists.us.dell.com> <200111292030.fATKU1s05921@vortex.physik.uni-konstanz.de> <3C075196.613894EA@zip.com.au>, <3C075196.613894EA@zip.com.au> <200112012209.fB1M92s12294@vortex.physik.uni-konstanz.de>

space-00002@vortex.physik.uni-konstanz.de wrote:
> 
> It is still the same in 2.4.17pre2 :-(
> 

Yes, well, it would be.

It seems that what's happening is that all your buffercache memory
is on the active list, and all your anonymous memory is on the
inactive list.   Consequently the logic in shrink_caches() which
is supposed to move pages onto the inactive list doesn't do anything - it
just sits there calling refill_inactive() with a zero argument all
the time.

You'll find that if you push the machine really hard - allocate
1.5x physical memory and touch it all then the VM will, eventually,
with great reluctance and much swapping, relinquish the 30 megabytes
of buffercache memory.  But it's out of whack.

I tested the pre7aa1 patches and it seemed possibly a little better,
but not right.

If we put anon pages on the active list instead, then shrink_caches()
and refill_inactive() start to do something, and they move that stale
old buffercache memory onto the inactive list where it can be freed.

This is just a random hack.  I don't understand what's going on in
the VM, let alone what's *supposed* to be going on.  And given the
state of documentation available to us,  I never will.


--- linux-2.4.17-pre2/mm/memory.c	Thu Nov 22 23:02:59 2001
+++ linux-akpm/mm/memory.c	Sat Dec  1 20:14:28 2001
@@ -1174,6 +1174,7 @@ static int do_anonymous_page(struct mm_s
 		flush_page_to_ram(page);
 		entry = pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
 		lru_cache_add(page);
+		activate_page(page);
 	}
 
 	set_pte(page_table, entry);

-

  reply	other threads:[~2001-12-02  4:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200111291201.fATC1pd04206@lists.us.dell.com>
2001-11-29 20:39 ` buffer/memory strangeness in 2.4.16 space-00002
2001-11-30  9:29   ` Andrew Morton
2001-12-01 22:07     ` buffer/memory strangeness in 2.4.16 / 2.4.17pre2 space-00002
2001-12-02  4:43       ` Andrew Morton [this message]
2001-12-02 12:17         ` Rik van Riel
2001-12-02 17:08           ` space-00002
2001-12-14  1:30 ` buffer/memory strangeness in 2.4.16; fixed in 2.4.17-rc1 space-00002

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C09B168.401E61C9@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=space-00002@vortex.physik.uni-konstanz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox