mm/filemap.c: add comment for confusing logic in page_cache_tree_insert()
authorKirill A. Shutemov <[email protected]>
Tue, 13 Dec 2016 00:43:17 +0000 (16:43 -0800)
committerLinus Torvalds <[email protected]>
Tue, 13 Dec 2016 02:55:08 +0000 (18:55 -0800)
Unlike THP, hugetlb pages are represented by one entry in the
radix-tree.

[[email protected]: tweak comment]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Kirill A. Shutemov <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Cc: Jan Kara <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/filemap.c

index 50b52fe51937ca70e62a33ab1553aef9b77ad1a0..caa779f8797fcba05e856732779ca411d8b2781a 100644 (file)
@@ -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 are represented by one entry in the radix tree */
+       nr = PageHuge(page) ? 1 : hpage_nr_pages(page);
 
        VM_BUG_ON_PAGE(!PageLocked(page), page);
        VM_BUG_ON_PAGE(PageTail(page), page);