From: R.E.Wolff@BitWizard.nl (Rogier Wolff)
To: "Stephen C. Tweedie" <sct@dcs.ed.ac.uk>
Cc: torvalds@transmeta.com, blah@kvack.org, H.H.vanRiel@fys.ruu.nl,
nahshon@actcom.co.il, alan@lxorguk.ukuu.org.uk, paubert@iram.es,
linux-kernel@vger.rutgers.edu, mingo@chiara.csoma.elte.hu,
linux-mm@kvack.org
Subject: Re: Fairness in love and swapping
Date: Thu, 26 Feb 1998 09:05:55 +0100 (MET) [thread overview]
Message-ID: <199802260805.JAA00715@cave.BitWizard.nl> (raw)
In-Reply-To: <199802252032.UAA01920@dax.dcs.ed.ac.uk> from "Stephen C. Tweedie" at Feb 25, 98 08:32:02 pm
Stephen C. Tweedie wrote:
> I noticed something rather unfortunate when starting up two of these
> tests simultaneously, each test using a bit less than total physical
> memory. The first test gobbled up the whole of ram as expected, but the
> second test did not. What happened was that the contention for memory
> was keeping swap active all the time, but the processes which were
> already all in memory just kept running at full speed and so their pages
> all remained fresh in the page age table. The newcomer processes were
> never able to keep a page in memory long enough for their age to compete
> with the old process' pages, and so I had a number of identical
> processes, half of which were fully swapped in and half of which were
> swapping madly.
>
> Needless to say, this is highly unfair, but I'm not sure whether there
> is any easy way round it --- any clock algorithm will have the same
> problem, unless we start implementing dynamic resident set size limits.
[ Processes P1 and P2 both need the same amount of CPU time, I've noted
the "completion percentages" at the top. ]
If you run it like this, you'll get:
0 50 100
P1 <---- in memory ---->
0 5 50 100
P2 < swapping like mad ><---- in memory --->
If you'd have enough memory for two of them you'd get:
0 50 100
P1 <--------------- in memory ------------>
0 50 100
P2 <--------------- in memory ------------>
but if the system would be "fair" we would get:
0 5 10 15
P1 <------ swapping --- like --- mad ------------------- ....
0 5 10 15
P2 <------ swapping --- like --- mad ------------------- ....
So.... In some cases, this behaviour is exactly what you want. What we
really need is that some mechanism that actually determines in the
first and last case that the system is thrashing like hell, and that
"swapping" (as opposed to paging) is becoming a required
strategy. That would mean putting a "page-in" ban on each process for
relatively long stretches of time. These should become longer with
each time that it occurs. That way, you will get:
0 50 51 100
P1 <in memory>...........<in memory>
0 1 50 51 100
P2 ...........<in memory>...........<in memory>
By making the periods longer, you will cater for larger machines where
getting the working set into main memory might take a long time (think
about a machine with 4G core, and a disk subsystem that reaches 4Mb (*)
per second on "random access paging". That's a quarter of an hour
worth of swapping before that 3.6G process is swapped in....)
Regards,
Roger Wolff.
(*) That's about 10 fast disks in parallel. (**)
(**) But keeping 10 disks busy in this case is impossible: Your
process (who "knows" what the next block will be) blocks until the
block is paged in....
--
If it's there and you can see it, it's REAL |___R.E.Wolff@BitWizard.nl |
If it's there and you can't see it, it's TRANSPARENT | Tel: +31-15-2137555 |
If it's not there and you can see it, it's VIRTUAL |__FAX:_+31-15-2138217 |
If it's not there and you can't see it, it's GONE! -- Roy Wilks, 1983 |_____|
next prev parent reply other threads:[~1998-02-26 8:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-02-25 20:32 Stephen C. Tweedie
1998-02-25 21:02 ` Linus Torvalds
1998-02-25 21:44 ` Rik van Riel
1998-02-25 21:39 ` Dr. Werner Fink
1998-02-25 22:27 ` Rik van Riel
1998-02-26 11:03 ` Dr. Werner Fink
1998-02-26 11:34 ` Rik van Riel
1998-02-26 18:57 ` Dr. Werner Fink
1998-02-26 19:32 ` Rik van Riel
1998-02-26 22:44 ` Stephen C. Tweedie
1998-02-26 23:34 ` Rik van Riel
1998-02-27 19:41 ` Stephen C. Tweedie
1998-03-02 16:19 ` Rik van Riel
1998-03-02 22:35 ` Stephen C. Tweedie
1998-03-02 23:14 ` Rik van Riel
1998-03-03 22:59 ` Stephen C. Tweedie
1998-02-26 8:05 ` Rogier Wolff [this message]
1998-02-26 13:00 ` Dr. Werner Fink
1998-02-26 22:36 ` Stephen C. Tweedie
1998-02-26 23:20 ` Dr. Werner Fink
1998-02-26 14:30 ` Rik van Riel
1998-02-26 22:41 ` Stephen C. Tweedie
1998-02-26 23:21 ` Rik van Riel
1998-02-26 22:33 ` Stephen C. Tweedie
1998-02-26 22:49 ` Rik van Riel
1998-02-27 2:56 ` Michael O'Reilly
[not found] <199802270729.IAA00680@cave.BitWizard.nl>
1998-02-27 11:26 ` Rik van Riel
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=199802260805.JAA00715@cave.BitWizard.nl \
--to=r.e.wolff@bitwizard.nl \
--cc=H.H.vanRiel@fys.ruu.nl \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=blah@kvack.org \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=mingo@chiara.csoma.elte.hu \
--cc=nahshon@actcom.co.il \
--cc=paubert@iram.es \
--cc=sct@dcs.ed.ac.uk \
--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