From: Jan Harkes <jaharkes@cs.cmu.edu>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Jeff Garzik <jgarzik@mandrakesoft.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Christian Borntrdger <linux-kernel@borntraeger.net>,
Derek Glidden <dglidden@illusionary.com>
Subject: Re: Requirement: swap = RAM x 2.5 ??
Date: Wed, 6 Jun 2001 21:29:24 -0400 [thread overview]
Message-ID: <20010606212923.A14060@cs.cmu.edu> (raw)
In-Reply-To: <3B1D5ADE.7FA50CD0@illusionary.com> <991815578.30689.1.camel@nomade> <20010606095431.C15199@dev.sportingbet.com> <0106061316300A.00553@starship> <200106061528.f56FSKa14465@vindaloo.ras.ucalgary.ca> <000701c0ee9f$515fd6a0$3303a8c0@einstein> <3B1E52FC.C17C921F@mandrakesoft.com> <m1snhd5u2s.fsf@frodo.biederman.org>
In-Reply-To: <m1snhd5u2s.fsf@frodo.biederman.org>
On Wed, Jun 06, 2001 at 12:42:03PM -0600, Eric W. Biederman wrote:
> Jeff Garzik <jgarzik@mandrakesoft.com> writes:
> > I'm sorry but this is a regression, plain and simple.
> >
> > Previous versons of Linux have worked great on diskless workstations
> > with NO swap.
> >
> > Swap is "extra space to be used if we have it" and nothing else.
>
> Given the slow speed of disks to use them efficiently when you are using
> swap some additional rules apply.
>
> In the worse case when swapping is being used you get:
> Virtual Memory = RAM + (swap - RAM).
>
> That cannot be improved. You can increase your likely hood that that
> case won't come up, but that is a different matter entirely.
I believe you are taking the right approach to the problem, which is not
to complain about that we need 2*RAM, but to try and figure out _why_ we
need 2*RAM.
As far as I can make out, any pages that at one time got swapped out,
will remain in swap. It is even there when there are no more references
to the page, but will be reclaimed lazily (i.e. when we need to swap
something new out).
I'm assuming the reason we need SWAP > RAM is because once swap is filled
only the subset of VM users that occupy this space are candidates for
further swapping. I'm assuming this probably has a significant impact on
long-running processes that have more chance of being pushed into swap
at some point.
The advantage of this is that when we need to remove a clean page that
is already in swap we can simply discard the copy in ram, paying only a
swap-in penalty. Dirty pages will have to be re-written, but we don't
need to find a place to put them, swap is already reserved. If we wanted
reclaim swap pages that were swapped into ram, we need to find a place
to swap to, swap the page out, and eventually swap it back in. Obviously
a lot more expensive.
However, we must have pushed the page into swap because it was not
'pageable'. i.e. it got dirtied, and there is no underlying file to
write it back to, shm, private mmap, or dirty heap. So there is infact a
high likelyhood that the page will not be clean when we have to swap it
out again.
Now if we would reclaim not just dead swap pages, but also pages that
have been swapped in but are dirtied, the 'additional cost' only
involves finding a place to swap to. The nice thing is that with fewer
used swap pages as a result of agressive reclaiming of swapped but in
the mean time swapped back in and dirtied pages it should become a lot
easier to find a free spot (until we are really overcommitted).
I don't know how feasable it is to tell from a given swap page, whether
there is a dirtied copy present in ram, but we could drop the swap
reference when the copy in ram is modified, turning the swap page into a
dead page and letting the regular reclamation pick it up.
Jan
next prev parent reply other threads:[~2001-06-07 1:29 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-05 22:19 Break 2.4 VM in five easy steps Derek Glidden
2001-06-05 23:38 ` Jeffrey W. Baker
2001-06-06 1:42 ` Russell Leighton
2001-06-06 7:14 ` Sean Hunter
2001-06-06 7:47 ` Jonathan Morton
2001-06-06 2:16 ` Andrew Morton
2001-06-06 3:19 ` Derek Glidden
2001-06-06 8:19 ` Xavier Bestel
2001-06-06 8:54 ` Sean Hunter
2001-06-06 9:16 ` Xavier Bestel
2001-06-06 9:25 ` Sean Hunter
2001-06-06 10:04 ` Jonathan Morton
2001-06-06 9:57 ` Dr S.M. Huen
2001-06-06 10:06 ` DBs (ML)
2001-06-06 10:08 ` Vivek Dasmohapatra
2001-06-06 10:19 ` Lauri Tischler
2001-06-06 10:22 ` Sean Hunter
2001-06-06 10:48 ` Alexander Viro
2001-06-06 16:58 ` dean gaudet
2001-06-06 17:10 ` Remi Turk
2001-06-06 22:44 ` Kai Henningsen
2001-06-09 7:17 ` Rik van Riel
2001-06-06 16:47 ` dean gaudet
2001-06-06 17:17 ` Kurt Roeckx
2001-06-06 18:35 ` Dr S.M. Huen
2001-06-06 18:40 ` Mark Salisbury
2001-06-06 19:11 ` android
2001-06-07 0:27 ` Mike A. Harris
2001-06-07 0:20 ` Mike A. Harris
2001-06-09 8:16 ` Rik van Riel
2001-06-09 8:57 ` Mike A. Harris
2001-06-07 21:31 ` Shane Nay
2001-06-07 20:00 ` Marcelo Tosatti
2001-06-07 21:55 ` Shane Nay
2001-06-07 20:29 ` Marcelo Tosatti
2001-06-07 23:29 ` VM Report was:Re: " Shane Nay
2001-06-08 1:18 ` Jonathan Morton
2001-06-08 12:50 ` Mike Galbraith
2001-06-08 14:19 ` Tobias Ringstrom
2001-06-08 15:51 ` John Stoffel
2001-06-08 17:01 ` Mike Galbraith
2001-06-08 17:43 ` John Stoffel
2001-06-08 17:35 ` Marcelo Tosatti
2001-06-08 20:58 ` John Stoffel
2001-06-08 20:04 ` Marcelo Tosatti
2001-06-08 23:44 ` Jonathan Morton
2001-06-09 2:36 ` Andrew Morton
2001-06-09 6:33 ` Mark Hahn
2001-06-09 3:43 ` Mike Galbraith
2001-06-09 4:05 ` Jonathan Morton
2001-06-09 5:09 ` Mike Galbraith
2001-06-09 5:07 ` Mike Galbraith
2001-06-08 18:30 ` Mike Galbraith
2001-06-09 12:31 ` Zlatko Calusic
2001-06-09 3:34 ` Rik van Riel
2001-06-08 16:51 ` Mike Galbraith
2001-06-08 19:09 ` Tobias Ringstrom
2001-06-09 4:36 ` Mike Galbraith
2001-06-06 11:16 ` Daniel Phillips
2001-06-06 15:28 ` Richard Gooch
2001-06-06 15:42 ` Christian Bornträger
2001-06-06 15:57 ` Requirement: swap = RAM x 2.5 ?? Jeff Garzik
2001-06-06 16:12 ` Richard Gooch
2001-06-06 16:15 ` Jeff Garzik
2001-06-06 16:19 ` Richard Gooch
2001-06-06 16:53 ` Mike Galbraith
2001-06-06 17:05 ` Greg Hennessy
2001-06-06 18:42 ` Eric W. Biederman
2001-06-07 1:29 ` Jan Harkes [this message]
2001-06-06 17:14 ` Break 2.4 VM in five easy steps Ben Greear
2001-06-06 12:07 ` Jonathan Morton
2001-06-06 13:58 ` Gerhard Mack
2001-06-08 4:56 ` C. Martins
2001-06-06 14:41 ` Derek Glidden
2001-06-06 20:29 ` José Luis Domingo López
2001-06-06 14:16 ` Disconnect
[not found] ` <3B1DEAC7.43DEFA1C@idb.hist.no>
2001-06-06 14:51 ` Derek Glidden
2001-06-06 21:34 ` Alan Cox
2001-06-09 8:07 ` Rik van Riel
2001-06-07 7:23 ` Helge Hafting
2001-06-07 16:56 ` Eric W. Biederman
2001-06-07 20:24 ` José Luis Domingo López
2001-06-06 4:03 ` Jeffrey W. Baker
2001-06-06 13:32 ` Eric W. Biederman
2001-06-06 14:41 ` Marc Heckmann
2001-06-06 14:51 ` Hugh Dickins
2001-06-06 13:08 ` Eric W. Biederman
2001-06-06 16:48 ` Jeffrey W. Baker
[not found] ` <m2lmn61ceb.fsf@sympatico.ca>
2001-06-06 14:37 ` Derek Glidden
2001-06-07 0:34 ` Mike A. Harris
2001-06-07 3:13 ` Miles Lane
2001-06-07 15:49 ` Derek Glidden
2001-06-07 19:06 ` Miles Lane
2001-06-09 5:57 ` Mike A. Harris
2001-06-06 18:59 ` Mike Galbraith
2001-06-06 19:39 ` Derek Glidden
2001-06-06 20:47 ` Linus Torvalds
2001-06-07 7:42 ` Eric W. Biederman
2001-06-07 8:11 ` Linus Torvalds
2001-06-07 8:54 ` Eric W. Biederman
2001-06-06 21:39 ` android
2001-06-06 22:08 ` Jonathan Morton
2001-06-06 22:27 ` android
2001-06-06 22:33 ` Antoine
2001-06-06 22:38 ` Robert Love
2001-06-06 22:40 ` Jonathan Morton
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=20010606212923.A14060@cs.cmu.edu \
--to=jaharkes@cs.cmu.edu \
--cc=dglidden@illusionary.com \
--cc=ebiederm@xmission.com \
--cc=jgarzik@mandrakesoft.com \
--cc=linux-kernel@borntraeger.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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