linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: broken VM in 2.4.10-pre9
@ 2001-09-16 15:19 Ricardo Galli
  2001-09-16 15:23 ` Michael Rothwell
  0 siblings, 1 reply; 76+ messages in thread
From: Ricardo Galli @ 2001-09-16 15:19 UTC (permalink / raw)
  To: linux-kernel

> So whether Linux uses swap or not is a 100% meaningless indicator of
> "goodness". The only thing that matters is how well the job gets done,
> ie was it reasonably responsive, and did the big untars finish quickly..

I am running 2.4.9 on a PII with 448MB RAM. After listening a couple of
hours MP3 from the /dev/cdrom and KDE started, more than 70MB went to
swap, about 300 MB in cache and KDE takes about 15-20 seconds just for
logging out and showing the greeting console.

Obviously, all apps went to disk to leave space for caching mp3 files that
are read only once. Altough logging out is not a very often process...

Regards,


--ricardo



^ permalink raw reply	[flat|nested] 76+ messages in thread
* Re: Linux VM design
@ 2001-09-25 11:00 VDA
  2001-09-25 11:07 ` Rik van Riel
  0 siblings, 1 reply; 76+ messages in thread
From: VDA @ 2001-09-25 11:00 UTC (permalink / raw)
  To: Andrea Arcangeli, Rik van Riel, Alexander Viro, Daniel Phillips
  Cc: linux-kernel

Hi VM folks,

I'd like your comments on this (rather simplistic) hypothetic
VM description. If you know what's wrong with it, please tell me.


Ram page can be:

free
        Not used by anything.

clean non-backed
        Initially allocated page. All such pages share
        global zero-filled readonly page. On write COW magic
        is making a dirty non-backed copy
        
dirty non-backed
        This ram page have copy neither in swap nor in fs.
        Under light i/o load page laundering machinery
        _may_ allocate swap for it and write it back.
        Only after a timeout. No point in writing back
        too early/too often. This laundering can be
        turned off completely without much harm.

clean swap-backed
        This ram page has a copy on swap. It is not modified
        (either swapped in or is already laundered)
        Note: as soon as it gets dirty, it becomes
        dirty *non-backed* and swap page is freed
        
dirty swap-backed
        This ram page was modified some time ago, become
        dirty non-backed, and is being written back right now
        to newly allocated swap page (laundering or
        (evicting LRU ram page under memory pressure)).
        A temporary stage. Turns clean swap-backed
        as soon as write completes.

clean fs-backed
        This ram page is mmapped from a file and is not modified
        or already written back
        
dirty fs-backed
        This ram page is mmapped from a file and is modified.
        It needs to be written back within reasonable timeout
        to keep fs data consistent


How LRU works
        
All non-free ram pages are in LRU list. Top ram page on the list
is the most recently accessed one. Bottom one is least recently
accessed one.

VM periodically scans all process pte's looking for 'accessed'
and 'dirty' bits, resets those bits, modifies page status:

Accessed bit set: Move ram page to top of LRU list.
Dirty bit set:
    clean non-backed  -  can't happen (global zero page is RO)
    dirty non-backed  -> dirty non-backed
    clean swap-backed -> dirty non-backed (note: swap page freed!)
    dirty swap-backed -> dirty non-backed (note: complicated case. See below)
    clean fs-backed   -> dirty fs-backed
    dirty fs-backed   -> dirty fs-backed

Complicated case:
We are writing ram page to swap either due to:
1) Evicting LRU ram page under memory pressure
2) Laundering ram page under light io load
and page gets accessed/dirtied by some process.
In first case we are in deep trouble. To prevent this we must
unmap ram page from all processes before evicting.
In second case we are fine, however, laundering io is wasted.
Ram page should become dirty non-backed again and moved
to top of LRU list, swap page freed.


Ram page eviction

We evict ram pages when we have no free ram pages and
we have a memory request:
1) a process accesses not-present (swapped out) page
2) a process accesses not-present page mmaped to a file
3) a process writes to clean non-backed ram page and COW needs
   new ram page to make a copy

Rate of such evictions is a good measure of mem pressure.

We evict ram page from the bottom of LRU list by unmapping it from
all processes, writing back to fs or allocating swap and writing back
to swap if it is dirty and using freed ram page to fulfill memory
request.
-- 
Best regards, VDA
mailto:VDA@port.imtp.ilyichevsk.odessa.ua



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

end of thread, other threads:[~2001-09-25 16:03 UTC | newest]

Thread overview: 76+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-16 15:19 broken VM in 2.4.10-pre9 Ricardo Galli
2001-09-16 15:23 ` Michael Rothwell
2001-09-16 16:33   ` Rik van Riel
2001-09-16 16:50     ` Andreas Steinmetz
2001-09-16 17:12       ` Ricardo Galli
2001-09-16 17:06     ` Ricardo Galli
2001-09-16 17:18       ` Jeremy Zawodny
2001-09-16 18:45       ` Stephan von Krawczynski
2001-09-21  3:16         ` Bill Davidsen
2001-09-21 10:21         ` Stephan von Krawczynski
2001-09-21 14:08           ` Bill Davidsen
2001-09-21 14:23             ` Rik van Riel
2001-09-23 13:13               ` Eric W. Biederman
2001-09-23 13:27                 ` Rik van Riel
2001-09-21 10:43         ` Stephan von Krawczynski
2001-09-21 12:13           ` Rik van Riel
2001-09-21 12:55           ` Stephan von Krawczynski
2001-09-21 13:01             ` Rik van Riel
2001-09-22 11:01           ` Daniel Phillips
2001-09-22 20:05             ` Rik van Riel
2001-09-24  9:36           ` Linux VM design VDA
2001-09-24 11:06             ` Dave Jones
2001-09-24 12:15               ` Kirill Ratkin
2001-09-24 13:29             ` Rik van Riel
2001-09-24 14:05               ` VDA
2001-09-24 14:37                 ` Rik van Riel
2001-09-24 14:42                 ` Rik van Riel
2001-09-24 18:37             ` Daniel Phillips
2001-09-24 19:32               ` Rik van Riel
2001-09-24 17:27                 ` Rob Landley
2001-09-24 21:48                   ` Rik van Riel
2001-09-25  9:58                 ` Daniel Phillips
2001-09-25 16:03               ` bill davidsen
2001-09-24 18:46             ` Jonathan Morton
2001-09-24 19:16               ` Daniel Phillips
2001-09-24 19:11             ` Dan Mann
2001-09-25 10:55             ` VDA
2001-09-16 18:16     ` broken VM in 2.4.10-pre9 Stephan von Krawczynski
2001-09-16 19:43     ` Linus Torvalds
2001-09-16 19:57       ` Rik van Riel
2001-09-16 20:17       ` Rik van Riel
2001-09-16 20:29       ` Andreas Steinmetz
2001-09-16 21:28         ` Linus Torvalds
2001-09-16 22:47           ` Alex Bligh - linux-kernel
2001-09-16 22:55             ` Linus Torvalds
2001-09-16 22:59           ` Stephan von Krawczynski
2001-09-16 22:14             ` Linus Torvalds
2001-09-16 23:29               ` Stephan von Krawczynski
2001-09-17 15:35             ` Stephan von Krawczynski
2001-09-17 15:51               ` Linus Torvalds
2001-09-17 16:34               ` Stephan von Krawczynski
2001-09-17 16:46                 ` Linus Torvalds
2001-09-17 17:20                 ` Stephan von Krawczynski
2001-09-17 17:37                   ` Linus Torvalds
2001-09-17  0:37       ` Daniel Phillips
2001-09-17  1:07         ` Linus Torvalds
2001-09-17  2:23           ` Daniel Phillips
2001-09-17  5:11           ` Jan Harkes
2001-09-17 12:33             ` Daniel Phillips
2001-09-17 12:41               ` Rik van Riel
2001-09-17 14:49                 ` Daniel Phillips
2001-09-17 16:14               ` Jan Harkes
2001-09-17 16:34                 ` Linus Torvalds
2001-09-17 15:38             ` Linus Torvalds
2001-09-17 12:26           ` Rik van Riel
2001-09-17 15:42             ` Linus Torvalds
2001-09-18 12:04               ` Rik van Riel
2001-09-17 17:33             ` Linus Torvalds
2001-09-17 18:07               ` Linus Torvalds
2001-09-18 12:09               ` Rik van Riel
2001-09-21  3:10       ` Bill Davidsen
2001-09-17  8:06     ` Eric W. Biederman
2001-09-17 12:12       ` Rik van Riel
2001-09-17 15:45         ` Eric W. Biederman
2001-09-25 11:00 Linux VM design VDA
2001-09-25 11:07 ` 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;
as well as URLs for NNTP newsgroup(s).