linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mark Hahn <hahn@coffee.psychology.mcmaster.ca>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: linux-mm@kvack.org
Subject: Re: how text page of executable are shared ?
Date: Tue, 28 Mar 2000 10:58:00 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.10.10003281019140.5753-100000@coffee.psychology.mcmaster.ca> (raw)
In-Reply-To: <20000328142253.A16752@redhat.com>

> > The page table entries of both the process will have entry for this page.
> > But when the page is discarded only the page entry of only one process get
> > cleared , this is what I have understood from the swap_out () function .
> 
> Yes.  swap_out() is responsible for unlinking pages from process page 
> tables.  In the case you describe, the page will still have outstanding
> references, from the other process and from the page cache.  Only when
> the page cache cleanup function (shrink_mmap) gets called, after all of
> the ptes to the page have been cleared, will the page be freed.

could you comment on a problem I'm seeing in the current (pre3) VM?
the situation is a 256M machine, otherwise idle (random daemons, no X,
couple ssh's) and a process that sequentially traverses 12 40M files
by mmaping them (and munmapping them, in order, one at a time.)

the observation is that all goes well until the ~6th file, when we 
run out of unused ram.  then we start _swapping_!  the point is that 
shrink_mmap should really be scavenging those now unmapped files,
shouldn't it?

could something be happening, like we're accidentally setting PG_referenced
on pages that are only in use by the page cache?  or perhaps someone not
adjusting page_cache_size properly?

in shrink_mmap:
                /*
                 * We can't free pages unless there's just one user
                 * (count == 2 because we added one ourselves above).
                 */
                if (page_count(page) != 2)
                        goto cache_unlock_continue;

is this wrong, since the page cache holds a reference?


thanks, mark hahn.

--
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-03-28 15:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-28  3:51 pnilesh
2000-03-28 13:22 ` Stephen C. Tweedie
2000-03-28 15:58   ` Mark Hahn [this message]
2000-03-28 18:10     ` Andrea Arcangeli
2000-03-29  1:01     ` Stephen C. Tweedie
2000-03-29  1:59       ` Kanoj Sarcar
2000-03-29  5:21       ` Andrew Morton
2000-03-29 13:45         ` Stephen C. Tweedie
2000-03-29  7:46 pnilesh
2000-03-29 13:49 ` Stephen C. Tweedie

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.10.10003281019140.5753-100000@coffee.psychology.mcmaster.ca \
    --to=hahn@coffee.psychology.mcmaster.ca \
    --cc=linux-mm@kvack.org \
    --cc=sct@redhat.com \
    /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