linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen C. Tweedie" <sct@redhat.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Andrea Arcangeli <andrea@suse.de>, Ben LaHaise <bcrl@redhat.com>,
	Marcelo Tosatti <marcelo@conectiva.com.br>,
	Rik van Riel <riel@conectiva.com.br>,
	Stephen Tweedie <sct@redhat.com>,
	linux-mm@kvack.org
Subject: Re: SWAP_MAP_MAX: How?
Date: Fri, 24 Aug 2001 12:19:51 +0100	[thread overview]
Message-ID: <20010824121951.A4389@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0108241158230.979-100000@localhost.localdomain>; from hugh@veritas.com on Fri, Aug 24, 2001 at 12:16:12PM +0100

Hi,

On Fri, Aug 24, 2001 at 12:16:12PM +0100, Hugh Dickins wrote:
> The SWAP_MAP_MAX case imposes a severe constraint on how swapoff
> may be implemented correctly.  I am still struggling to understand
> how a swap count might reach SWAP_MAP_MAX 0x7fff on 2.4.  Please,
> can someone enlighten me?

The swap count is incremented for every separate mm which references a
page.  That basically means that demand-zero (heap and anon mmap)
pages which get created by a parent process and then shared by a
forked child process will get the swap count bumped on that page
whenever it gets swapped.  The raised count only survives as long as
neither parent nor child modifies the page --- as soon as
copy-on-write occurs, the process which modified the page gets a new
copy and the reference count on the original page gets decremented.

Of course, any one process can fork as many times as it likes, leading
to multiply-raised swap counts.

Cheers,
 Stephen
--
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/

  reply	other threads:[~2001-08-24 11:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-24 11:16 Hugh Dickins
2001-08-24 11:19 ` Stephen C. Tweedie [this message]
2001-08-24 12:42   ` Hugh Dickins
2001-08-24 13:07     ` Stephen C. Tweedie
2001-08-25 10:35       ` Hugh Dickins

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=20010824121951.A4389@redhat.com \
    --to=sct@redhat.com \
    --cc=andrea@suse.de \
    --cc=bcrl@redhat.com \
    --cc=hugh@veritas.com \
    --cc=linux-mm@kvack.org \
    --cc=marcelo@conectiva.com.br \
    --cc=riel@conectiva.com.br \
    /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