linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Fairness in love and swapping
@ 1998-02-25 20:32 Stephen C. Tweedie
  1998-02-25 21:02 ` Linus Torvalds
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Stephen C. Tweedie @ 1998-02-25 20:32 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Stephen C. Tweedie, Benjamin C.R. LaHaise, Rik van Riel,
	Itai Nahshon, Alan Cox, paubert, linux-kernel, Ingo Molnar,
	linux-mm

Hmm.

I've been continuing to test the swapper stuff, and Linus has a couple
of patches which will help with spurious warnings --- I'll make a fresh
patch against 89pre1 shortly unless he beats me to it.  While testing, I
discovered a rather nasty behaviour inherent in the swapper.

The test program I was using allocates a large heap of pages and writes
different signatures to each page (keeping a copy of each signature in a
separate, compressed array).  It then forks off a number of reader
processes which continually validate the signatures in the heap pages,
and writer processes which do the same except that every so often they
write a new signature to a page and to the pattern table.  If the total
heap size exceeds available memory, then the whole thing has to swap
shared pages both in and out to work, and the writer tasks perform COW
on the shared pages.

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.

Just a thought..

Cheers,
 Stephen.

^ permalink raw reply	[flat|nested] 27+ messages in thread
[parent not found: <199802270729.IAA00680@cave.BitWizard.nl>]

end of thread, other threads:[~1998-03-03 23:00 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-25 20:32 Fairness in love and swapping 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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox