Commit ceddc3a52d783fabbf1ba623601419b9d6337194
Committed by
Linus Torvalds
1 parent
edcf4748cd
Exists in
master
and in
39 other branches
mm: document is_page_cache_freeable()
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> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff
mm/vmscan.c
... | ... | @@ -286,6 +286,11 @@ |
286 | 286 | |
287 | 287 | static inline int is_page_cache_freeable(struct page *page) |
288 | 288 | { |
289 | + /* | |
290 | + * A freeable page cache page is referenced only by the caller | |
291 | + * that isolated the page, the page cache radix tree and | |
292 | + * optional buffer heads at page->private. | |
293 | + */ | |
289 | 294 | return page_count(page) - page_has_private(page) == 2; |
290 | 295 | } |
291 | 296 |