linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@conectiva.com.br>
To: "Scott F. Kaplan" <sfkaplan@cs.amherst.edu>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] 2.2.17pre7 VM enhancement Re: I/O performance on
Date: Mon, 17 Jul 2000 12:31:08 -0300 (BRST)	[thread overview]
Message-ID: <Pine.LNX.4.21.0007171223210.30603-100000@duckman.distro.conectiva> (raw)
In-Reply-To: <39731E78.C152D049@cs.amherst.edu>

On Mon, 17 Jul 2000, Scott F. Kaplan wrote:
> Alan Cox wrote:
> > Modern OS designers are consistently seeing LFU work better. In our case this
> > is partly theory in the FreeBSD case its proven by trying it.
> 
> Have any of the FreeBSD people compiled some results to this
> effect?  I'd be interested to see under what circumstances LFU
> works better,

Say you're in the situation where 1/2 of your memory is
memory used by programs, memory which is used over and
over again.

The other half of your memory is used to cache the
multimedia data you're streaming or the files you're
exporting over NFS. This is mostly use-once memory.

If a sudden burst of IO occurs, LRU would evict memory
from the programs, memory which will be used again soon.
LFU, on the other hand, correctly evicts memory from the
cache ... especially the memory which was used only once.

> and just what approximations of both LRU and LFU are being used.  

Page aging. Basically the pages in memory are scanned periodically
(with the period being driven by memory pressure), if a page was
referenced since the last time, the page age/act_count is increased,
otherwise the page age/act_count is decreased. Pages are deactivated
(moved to the inactive list) when the age/act_count reaches 0.

if (test_and_clear_referenced(page)) {
	page->age += PG_AGE_ADV;
	if (page->age > PG_AGE_MAX)
		page->age = PG_AGE_MAX;
} else {
	page->age -= min(page->age, PG_AGE_DECL);
	if (page->age == 0)
		deactivate_page(page);
}

This is a nice approximation of LRU and LFU, one which comes
pretty close to LFU because of the linear decline. If we were
to use

	page->age /= 2;

as page age decreaser instead, we'd probably be closer to LRU.

It would be worth it to experiment a bit to see which of these
will work best.

> There could be something interesting in such results, as years
> of other experiments have shown otherwise.

I wonder if the speed difference between CPU, memory and hard disk
have changed over the years .. ;)

(or if system loads have changed a bit ... nowadays the working
set of processes usually fits in memory but there is a lot of
streaming IO going on in the background)

regards,

Rik
--
"What you're running that piece of shit Gnome?!?!"
       -- Miguel de Icaza, UKUUG 2000

http://www.conectiva.com/		http://www.surriel.com/

--
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.eu.org/Linux-MM/

  reply	other threads:[~2000-07-17 15:31 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20000629114407.A3914@redhat.com>
     [not found] ` <Pine.LNX.4.21.0006291330520.1713-100000@inspiron.random>
2000-06-29 13:00   ` [PATCH] 2.2.17pre7 VM enhancement Re: I/O performance on 2.4.0-test2 Stephen C. Tweedie
2000-07-06 10:35     ` Andrea Arcangeli
2000-07-06 13:29       ` Stephen C. Tweedie
2000-07-09 17:11         ` Swap clustering with new VM Marcelo Tosatti
2000-07-09 20:53           ` Andrea Arcangeli
2000-07-11  9:36             ` Stephen C. Tweedie
2000-07-09 20:31         ` [PATCH] 2.2.17pre7 VM enhancement Re: I/O performance on 2.4.0-test2 Andrea Arcangeli
2000-07-11 11:50           ` Stephen C. Tweedie
2000-07-11 16:17             ` Andrea Arcangeli
2000-07-11 16:36               ` Juan J. Quintela
2000-07-11 17:33                 ` Andrea Arcangeli
2000-07-11 17:45                   ` Rik van Riel
2000-07-11 17:54                     ` Andrea Arcangeli
2000-07-11 18:03                       ` Juan J. Quintela
2000-07-11 19:32                         ` Andrea Arcangeli
2000-07-12  0:05                           ` John Alvord
2000-07-12  0:52                             ` Andrea Arcangeli
2000-07-12 18:02                             ` Rik van Riel
2000-07-14  8:51               ` Stephen C. Tweedie
2000-07-11 17:32           ` Rik van Riel
2000-07-11 17:41             ` Andrea Arcangeli
2000-07-11 17:47               ` Rik van Riel
2000-07-11 18:00                 ` Andrea Arcangeli
2000-07-11 18:06                   ` Rik van Riel
2000-07-17  7:09                     ` [PATCH] 2.2.17pre7 VM enhancement Re: I/O performance on Yannis Smaragdakis
2000-07-17  9:28                       ` Stephen C. Tweedie
2000-07-17 13:01                         ` James Manning
2000-07-17 14:32                           ` Scott F. Kaplan
2000-07-17 14:53                         ` Rik van Riel
2000-07-17 16:44                           ` Manfred Spraul
2000-07-17 17:02                             ` Rik van Riel
2000-07-17 18:55                           ` Yannis Smaragdakis
2000-07-17 19:57                           ` John Fremlin
2000-07-17 14:46                       ` Alan Cox
2000-07-17 14:55                         ` Scott F. Kaplan
2000-07-17 15:31                           ` Rik van Riel [this message]
2000-07-14  9:01                   ` [PATCH] 2.2.17pre7 VM enhancement Re: I/O performance on 2.4.0-test2 Stephen C. Tweedie
2000-07-11 18:13               ` Juan J. Quintela
2000-07-11 20:57                 ` Roger Larsson
2000-07-11 22:49                   ` Juan J. Quintela
2000-07-12 16:01               ` Kev
2000-07-06 13:54       ` [PATCH] 2.2.17pre7 VM enhancement Re: I/O performance on2.4.0-test2 Roman Zippel

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=Pine.LNX.4.21.0007171223210.30603-100000@duckman.distro.conectiva \
    --to=riel@conectiva.com.br \
    --cc=linux-mm@kvack.org \
    --cc=sfkaplan@cs.amherst.edu \
    /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