linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@conectiva.com.br>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	linux-kernel@vger.rutgers.edu, linux-mm@kvack.org,
	MOLNAR Ingo <mingo@chiara.csoma.elte.hu>
Subject: Re: shrink_mmap SMP race fix
Date: Thu, 30 Mar 2000 18:19:23 -0300 (BRST)	[thread overview]
Message-ID: <Pine.LNX.4.21.0003301757450.1104-100000@duckman.conectiva> (raw)
In-Reply-To: <Pine.LNX.4.21.0003302216260.9850-100000@alpha.random>

On Thu, 30 Mar 2000, Andrea Arcangeli wrote:
> On Thu, 30 Mar 2000, Rik van Riel wrote:
> 
> >What matters is that the pages should spend _enough time_ in the
> >LRU list for them to have a chance to be reclaimed by the original
> >application. If we maintain a too small list, pages don't get
> >enough of a chance to be reclaimed by their application and the
> >"extra aging" benefit is minimal.
> 
> To avoid shrinking the real cache you have to get rid of the swap cache.
> 
> swap_out is just an engine that generate page cache. If you want
> to keep the good cache you have to shrink from the swap cache.
> The swap cache generated by the swap_out engine is by definition
> just old, it was belonging to a not recently accessed pte. So
> it's a very less interesting cache and preserving the very
> interesting page cache is better than preserving the polluting
> swap cache.

The reason to keep the LRU cache (of _unmapped_ pages) fairly
big is to cheaply increase the page aging from one-bit aging
to two-stage aging. That way we can do more precise page aging.

That this works has been demonstrated by the second chance
replacement patchlet that went into 2.2.15pre...

> >> Shrinking the unused swap cache first is the way to go.
> >
> >NOOOOOO!!  The only reason that the current VM behaves decently
> >at all is that all pages are treated equally. We _need_ to reclaim
> 
> I am now talking about theory, I tried that and it worked very better ;).
> See explanation above on why it gives a smooth swap behaviour.
> 
> Anyway I prefer to continue talking about this again when I'll
> have wrote the code so I'll try it out again and you'll play
> with it too.

That might be the better idea since there seems to be some
misunderstanding when talking about it in English :)

> >all pages in the same way and in the same queue because only then
> >we achieve automatic balancing between the different memory uses
> >in an efficient way.
> 
> If the swap cache page is mapped/used (like after shared swapin)
> shrink_mmap is not going to eat it. Only the cache pollution
> generated by the swap_out gets cleaned up. And it gets cleaned
> up in a dynamic lazy way as usual (if somebody fault in the swap
> cache before shrink_mmap eat it only minor fault happens as
> usual).

Point is, we should give the process a good amount of time
to fault their page back in. Otherwise page aging is just
the single NRU bit; in 2.2 we've already seen that that is
just not enough.

regards,

Rik
--
The Internet is not a network of computers. It is a network
of people. That is its real strength.

Wanna talk about the kernel?  irc.openprojects.net / #kernelnewbies
http://www.conectiva.com/		http://www.surriel.com/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

  reply	other threads:[~2000-03-30 21:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-30 15:16 Andrea Arcangeli
2000-03-30 15:43 ` Andrea Arcangeli
2000-03-30 17:17   ` Rik van Riel
2000-03-30 18:41     ` Andrea Arcangeli
2000-03-30 16:50 ` Andrea Arcangeli
2000-03-30 17:14 ` Rik van Riel
2000-03-30 18:57   ` Andrea Arcangeli
2000-03-30 19:34     ` Rik van Riel
2000-03-30 20:41       ` Andrea Arcangeli
2000-03-30 21:19         ` Rik van Riel [this message]
2000-03-30 21:55           ` Andrea Arcangeli

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=Pine.LNX.4.21.0003301757450.1104-100000@duckman.conectiva \
    --to=riel@conectiva.com.br \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=linux-mm@kvack.org \
    --cc=mingo@chiara.csoma.elte.hu \
    --cc=riel@nl.linux.org \
    --cc=torvalds@transmeta.com \
    /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