linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] filemap: add comment for confusing logic in page_cache_tree_insert()
@ 2016-11-10 16:36 Kirill A. Shutemov
  2016-11-10 17:21 ` Jan Kara
  2016-11-14 16:39 ` Johannes Weiner
  0 siblings, 2 replies; 3+ messages in thread
From: Kirill A. Shutemov @ 2016-11-10 16:36 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, Kirill A. Shutemov, Jan Kara

Unlike THP, hugetlb pages represented by one entry on radix-tree.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Jan Kara <jack@suse.cz>
---
 mm/filemap.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 849f459ad078..7602e8fabf5e 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -169,7 +169,10 @@ static int page_cache_tree_insert(struct address_space *mapping,
 static void page_cache_tree_delete(struct address_space *mapping,
 				   struct page *page, void *shadow)
 {
-	int i, nr = PageHuge(page) ? 1 : hpage_nr_pages(page);
+	int i, nr;
+
+	/* hugetlb pages represented by one entry on radix-tree */
+	nr = PageHuge(page) ? 1 : hpage_nr_pages(page);
 
 	VM_BUG_ON_PAGE(!PageLocked(page), page);
 	VM_BUG_ON_PAGE(PageTail(page), page);
-- 
2.9.3

--
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-14 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-10 16:36 [PATCH] filemap: add comment for confusing logic in page_cache_tree_insert() Kirill A. Shutemov
2016-11-10 17:21 ` Jan Kara
2016-11-14 16:39 ` Johannes Weiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox