linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: linux-mm@kvack.org
Subject: Re: Consistent page aging....
Date: 25 Jul 2001 10:02:00 -0600	[thread overview]
Message-ID: <m1itghgfpj.fsf@frodo.biederman.org> (raw)
In-Reply-To: <Pine.LNX.4.21.0107250701330.2948-100000@freak.distro.conectiva>

Marcelo Tosatti <marcelo@conectiva.com.br> writes:

> On 25 Jul 2001, Eric W. Biederman wrote:
> 
> > Marcelo Tosatti <marcelo@conectiva.com.br> writes:
> > 
> > > Sorry, Eric.
> > >
> > > The biggest 2.4 swapping bug is that we need to allocate swap space for a
> > > page to be able to age it. 
> > 
> > Well I guess biggest bug is a debatable title.  
> > 
> > > We had to be able to age pages without allocating swap space...
> > 
> > That sounds reasonable.  I haven't been over the aging code lately it
> > keeps changing.  You say this hasn't been fixed?  Looking... O.k. I
> > see what you are talking about.  
> > 
> > I don't see any technical reasons why we can't do this.  Doing it
> > without adding many extra special cases would require some thinking
> > but nothing fundamental says you can't have anonymous pages in the
> > active list. 
> 
> Right.

Let me clarify just a pinch.  I meant anonymous pages that have yet to
become swap cache pages.
 
> > You can't move mapped pages off of the active list but this holds true
> > anyway.
> > 
> > The only benefit this would bring is that after anonymous pages have
> > been converted to swappable pages they wouldn't start at the end of
> > the active_list.
> 
> Right now we have to allocate space on swap for any page which we want to
> add to the active list. (so we are able to age the anon pages as other
> cache pages)
> 
> > I can see how this would be helpful, but unless you benchmark this
> > I don't see how this can as the biggest 2.4 swapping bug.
> 
> Its the "2xRAM swap rule" problem.

I have trouble believing that.  We have nearly the same behavior
in 2.2.  The only intentional difference in 2.4 versus 2.2 is that 
2.2 removed pages from the swap cache when they become dirty, and 2.4
reuses the swap space.  This difference prompted Linus's message.

The "2xRAM swap rule problem", is a problem where a user uses 2.4 and
notices that they need more swap.  Since there has been publicity
that 2.4 needs more swap when swapping heavily, peoply commmonly to
jump to the conclusion that it is a known problem, and simply
complain.   That is the "2xRAM swap rule problem".

Given that a number of "2xRAM swap rule problem" reports tracked back
to having something like 90% of ram in dead swap cache pages, I know
that was one of the problems people complained about.  The classic
symptoms were:  a) swapoff locked up the system b) A large program was
started and filled most of swap.  The program ended.  The program
was restarted, and couldn't run because all of ram was now in dead
swap cache pages.

As far as actually requiring swap = 2xRAM the combination of keeping
pages in the swap cache after they are dirtied, and allocating the
swap space a little early achieves this, seems to achieve this
property, I admit.  Until I seem problem reports tracked back to this
I don't consider this at the top of my canidate list for the "2xRAM
swap rule problem".

> IMO having to allocate swap space to be able to do _aging_ on anonymous
> pages is just nonsense.

Be very clear on this because I sense some confusion.  We don't
``require'' allocation of swap space to do aging.  Allocating swap
space for aging just makes the code clean.

We do require swap allocation to remove a page from the page tables.
This is because of shared anonymous cow pages, formed by fork.  These
pages are extremely common (if generally short lived) so we don't want
them to get expensive.

> Now doing the swap allocation at the time we're writting out swap pages
> (page_launder()) makes sense for me.

We need to reserve space on the swap device before we remove the page
from the page tables.  If we cannot reserve space on the swap device
we are just wasting cpu time.

> Thats a 2.5 thing, of course...

You most be very careful in the swap path to keep from deadlocking the
system.

Eric

--
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-mm.org/

  parent reply	other threads:[~2001-07-25 16:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.21.0107250416230.2823-100000@freak.distro.conectiva>
2001-07-25 10:10 ` Eric W. Biederman
2001-07-25 10:11   ` Marcelo Tosatti
2001-07-25 15:49     ` Rik van Riel
2001-07-25 16:08       ` Eric W. Biederman
2001-07-25 16:42         ` Rik van Riel
2001-07-26  7:19           ` Eric W. Biederman
2001-07-25 16:02     ` Eric W. Biederman [this message]
2001-07-26 10:04       ` Marcelo Tosatti
2001-07-26 14:46         ` Eric W. Biederman
2001-07-27 23:45           ` Jordi Polo

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=m1itghgfpj.fsf@frodo.biederman.org \
    --to=ebiederm@xmission.com \
    --cc=linux-mm@kvack.org \
    --cc=marcelo@conectiva.com.br \
    /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