linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Motivation for page replace alg.?
@ 1999-12-09 10:21 Chris Vaill
  1999-12-09 19:37 ` afei
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Vaill @ 1999-12-09 10:21 UTC (permalink / raw)
  To: linux-mm

I'm a kernel newbie, and I apologize if my question is answered by
easily accessible docs, but I couldn't find any such answers in my
search.

I've been looking into the swap out routines, and in particular their
behavior when faced with several competing processes aggressively
allocating and using memory (more memory, collectively, than is
physically available).  I've found that this results in repeated
drastic swings in rss for each process over time.

As far as I can tell, this results from the way swap_cnt is separated
from rss.  A victim process is chosen because it has the highest
swap_cnt, but as its rss falls, the swap_cnt stays high, so the same
victim process is chosen over and over again until no more pages can
be swapped from that process, and swap_cnt is zeroed.  From my (very
naive) perspective, it seems that always choosing the same victim
process for swapping would not result in a good approximation of LRU.

My questions are, is my read of the code correct here, and is this the
intended behavior of the page replacement algorithm?  If so, what is
the motivation?  Is this based on some existing mm research, or
informal observation and testing, or something else entirely?

I've heard it mentioned that the swap routines were not meant to deal
with trashing procs, which is basically what I am testing here.
Obviously the swap routines work pretty well for normal, well-behaved
procs; I'm just trying to get a little insight into the design process
here.

Thanks for any info or pointers anyone can provide.

-Chris

P.S. I did my testing on 2.2.13, but it is my understanding that the
algorithm is the same in the 2.3 kernels.  Smack me if this is not the
case.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Motivation for page replace alg.?
  1999-12-09 10:21 Motivation for page replace alg.? Chris Vaill
@ 1999-12-09 19:37 ` afei
  1999-12-09 20:16   ` Rik van Riel
  0 siblings, 1 reply; 4+ messages in thread
From: afei @ 1999-12-09 19:37 UTC (permalink / raw)
  To: Chris Vaill; +Cc: linux-mm

Chris, we have done some analysis on this problem. Please check out the
online document about linux memory management at:
http://aa.eps.jhu.edu/~feiliu/Linux

sorry about the readability, it is converted from word. I will work on the
layout later, but the content is there.

Fei
On Thu, 9 Dec 1999, Chris Vaill wrote:

> I'm a kernel newbie, and I apologize if my question is answered by
> easily accessible docs, but I couldn't find any such answers in my
> search.
> 
> I've been looking into the swap out routines, and in particular their
> behavior when faced with several competing processes aggressively
> allocating and using memory (more memory, collectively, than is
> physically available).  I've found that this results in repeated
> drastic swings in rss for each process over time.
> 
> As far as I can tell, this results from the way swap_cnt is separated
> from rss.  A victim process is chosen because it has the highest
> swap_cnt, but as its rss falls, the swap_cnt stays high, so the same
> victim process is chosen over and over again until no more pages can
> be swapped from that process, and swap_cnt is zeroed.  From my (very
> naive) perspective, it seems that always choosing the same victim
> process for swapping would not result in a good approximation of LRU.
> 
> My questions are, is my read of the code correct here, and is this the
> intended behavior of the page replacement algorithm?  If so, what is
> the motivation?  Is this based on some existing mm research, or
> informal observation and testing, or something else entirely?
> 
> I've heard it mentioned that the swap routines were not meant to deal
> with trashing procs, which is basically what I am testing here.
> Obviously the swap routines work pretty well for normal, well-behaved
> procs; I'm just trying to get a little insight into the design process
> here.
> 
> Thanks for any info or pointers anyone can provide.
> 
> -Chris
> 
> P.S. I did my testing on 2.2.13, but it is my understanding that the
> algorithm is the same in the 2.3 kernels.  Smack me if this is not the
> case.
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://humbolt.geo.uu.nl/Linux-MM/
> 


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Motivation for page replace alg.?
  1999-12-09 19:37 ` afei
@ 1999-12-09 20:16   ` Rik van Riel
  1999-12-09 21:10     ` afei
  0 siblings, 1 reply; 4+ messages in thread
From: Rik van Riel @ 1999-12-09 20:16 UTC (permalink / raw)
  To: afei; +Cc: Chris Vaill, linux-mm

On Thu, 9 Dec 1999 afei@jhu.edu wrote:

> Chris, we have done some analysis on this problem. Please check out the
> online document about linux memory management at:
> http://aa.eps.jhu.edu/~feiliu/Linux
> 
> sorry about the readability, it is converted from word. I will work on the
> layout later, but the content is there.

I know this is a scholl assignment, but
would it be possible to publish the
docs on the web, for instance at the Linux-MM
site?

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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Motivation for page replace alg.?
  1999-12-09 20:16   ` Rik van Riel
@ 1999-12-09 21:10     ` afei
  0 siblings, 0 replies; 4+ messages in thread
From: afei @ 1999-12-09 21:10 UTC (permalink / raw)
  To: Rik van Riel; +Cc: afei, Chris Vaill, linux-mm

If the Linux-MM team would accept it, I am willing to contribute this
document to help to understand Linux memory management. But before that, I
need to clean up the document and make it more readable. I will later on
use Latex to do it (just some copy/paste).

Fei

On Thu, 9 Dec 1999, Rik van Riel wrote:

> On Thu, 9 Dec 1999 afei@jhu.edu wrote:
> 
> > Chris, we have done some analysis on this problem. Please check out the
> > online document about linux memory management at:
> > http://aa.eps.jhu.edu/~feiliu/Linux
> > 
> > sorry about the readability, it is converted from word. I will work on the
> > layout later, but the content is there.
> 
> I know this is a scholl assignment, but
> would it be possible to publish the
> docs on the web, for instance at the Linux-MM
> site?
> 
> Rik
> --
> The Internet is not a network of computers. It is a network
> of people. That is its real strength.
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://humbolt.geo.uu.nl/Linux-MM/
> 

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-12-09 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-09 10:21 Motivation for page replace alg.? Chris Vaill
1999-12-09 19:37 ` afei
1999-12-09 20:16   ` Rik van Riel
1999-12-09 21:10     ` afei

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