From: Johannes Weiner <hannes@cmpxchg.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, Christoph Lameter <cl@linux-foundation.org>
Subject: [patch 5/5] mm: document is_page_cache_freeable()
Date: Wed, 12 Aug 2009 10:32:09 +0200 [thread overview]
Message-ID: <1250065929-17392-5-git-send-email-hannes@cmpxchg.org> (raw)
In-Reply-To: <1250065929-17392-1-git-send-email-hannes@cmpxchg.org>
Enlighten the reader of this code about what reference count makes a
page cache page freeable.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Christoph Lameter <cl@linux-foundation.org>
---
mm/vmscan.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
v2: describe reference holders a bit better [thanks, Christoph]
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 4904986..5bb1055 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -286,6 +286,11 @@ static inline int page_mapping_inuse(struct page *page)
static inline int is_page_cache_freeable(struct page *page)
{
+ /*
+ * A freeable page cache page is referenced only by the caller
+ * that isolated the page, the page cache radix tree and
+ * optional buffer heads at page->private.
+ */
return page_count(page) - page_has_private(page) == 2;
}
--
1.6.4.13.ge6580
--
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:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-08-12 8:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-12 8:32 [patch 1/5] mm: drop unneeded double negations Johannes Weiner
2009-08-12 8:32 ` [patch 2/5] mm: introduce page_lru_base_type() Johannes Weiner
2009-08-14 6:56 ` KOSAKI Motohiro
2009-08-12 8:32 ` [patch 3/5] mm: return boolean from page_is_file_cache() Johannes Weiner
2009-08-14 6:56 ` KOSAKI Motohiro
2009-08-12 8:32 ` [patch 4/5] mm: return boolean from page_has_private() Johannes Weiner
2009-08-12 13:57 ` Christoph Lameter
2009-08-14 6:56 ` KOSAKI Motohiro
2009-08-12 8:32 ` Johannes Weiner [this message]
2009-08-12 13:58 ` [patch 5/5] mm: document is_page_cache_freeable() Christoph Lameter
2009-08-14 6:56 ` KOSAKI Motohiro
2009-08-14 6:56 ` [patch 1/5] mm: drop unneeded double negations KOSAKI Motohiro
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=1250065929-17392-5-git-send-email-hannes@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--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