[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: swap cache
[CC'd to kernelnewbies because people might be interested]
On Fri, 6 Apr 2001, Andrew Morton wrote:
> a little question, please.
>
> What _are_ swap cache pages? Are they pages which are known to
> have the same contents as underlying swap? And hence can be
> dropped and reused without doing I/O?
These are pages which are both in the page cache and on swap.
The concept was introduced because of eg sendmail and apache.
In Linux 2.0, we had the problem where we had enough memory,
but the parent process never swapped in those pages that the
child processes needed (because the parent never needed them)
and we had a heavy swap-in load with lots of memory free.
The swap cache, OTOH, gives us a way to look up the pages
our sibling processes swapped in so we can avoid the disk
IO. We also use it to be able to do some swapin readahead,
because we can look up the pages later.
It uses the swapper_inode and the normal pagecache functions
to look up swap pages.
[Damn, I should save this in html and put it online on
linux-mm.org ...]
regards,
Rik
--
Linux MM bugzilla: http://linux-mm.org/bugzilla.shtml
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...
http://www.surriel.com/
http://www.conectiva.com/ http://distro.conectiva.com/
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.kernelnewbies.org/