From: Andrea Arcangeli <andrea@suse.de>
To: Mark Hahn <hahn@coffee.psychology.mcmaster.ca>
Cc: "Stephen C. Tweedie" <sct@redhat.com>, linux-mm@kvack.org
Subject: Re: how text page of executable are shared ?
Date: Tue, 28 Mar 2000 20:10:57 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.21.0003282006550.1383-100000@alpha.random> (raw)
In-Reply-To: <Pine.LNX.4.10.10003281019140.5753-100000@coffee.psychology.mcmaster.ca>
On Tue, 28 Mar 2000, Mark Hahn wrote:
>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?
That is right. At that point the miniumum count is 2 (there you could
say also:
if (page_count < 2)
BUG()
if you want).
1 reference is in the page cache and 1 reference is for the additional
get_page that shrink_mmap does to avoid the page to be freed under it.
Thus if the page count is 2 we can go ahead and release the page. If the
page count is != 2 (that means >2) we can't play with such page since
somebody else is using it.
Andrea
--
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/
next prev parent reply other threads:[~2000-03-28 18:10 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
2000-03-28 18:10 ` Andrea Arcangeli [this message]
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.21.0003282006550.1383-100000@alpha.random \
--to=andrea@suse.de \
--cc=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