linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave McCracken <dmccr@us.ibm.com>
To: Carl Spalletta <cspalletta@yahoo.com>, linux-mm@kvack.org
Subject: Re: hard question re: swap cache
Date: Wed, 28 May 2003 09:53:46 -0500	[thread overview]
Message-ID: <21290000.1054133626@baldur.austin.ibm.com> (raw)
In-Reply-To: <20030527214157.31893.qmail@web41501.mail.yahoo.com>

Your question is a bit ambiguous because in kernel terms there are two
distinct cases.

A shared page, ie one mapped by mmap or shmmap is not anonymous in kernel
terms.  It has a temporary file created for the region.  A shared page in
this file is tracked through the page cache, so it's trivially found via
either page cache lookup or by pagein through file system calls.

A truly anonymous page is generally either bss space or stack, and can only
become shared through fork.  When a page of this type is unmapped, its
address in swap space is written into the page table entry.  The page is
also put into the swap cache at this time.  When the process tries to map
the page again, it uses the swap address to look first in the swap cache,
or, failing that, read it from swap space.

An additional twist to this is that pages are not unmapped for swapout on a
per-process basis in 2.5.  Page stealing is done via the active and
inactive lists, which are by physical page.  They are unmapped in all
processes at the same time by using the pte_chain mechanism.

Dave McCracken

======================================================================
Dave McCracken          IBM Linux Base Kernel Team      1-512-838-3059
dmccr@us.ibm.com                                        T/L   678-3059

--
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-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  parent reply	other threads:[~2003-05-28 14:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-27 21:41 Carl Spalletta
2003-05-28  0:08 ` Hugh Dickins
2003-05-28 14:53 ` Dave McCracken [this message]
2003-05-27 23:04 Carl Spalletta
2003-05-28 10:01 ` Sean Neakums

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=21290000.1054133626@baldur.austin.ibm.com \
    --to=dmccr@us.ibm.com \
    --cc=cspalletta@yahoo.com \
    --cc=linux-mm@kvack.org \
    /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