mm/khugepaged: convert release_pte_pages() to use folios
authorVishal Moola (Oracle) <vishal.moola@gmail.com>
Sat, 14 Jan 2023 00:15:56 +0000 (16:15 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Feb 2023 06:33:05 +0000 (22:33 -0800)
Converts release_pte_pages() to use folios instead of pages.

Link: https://lkml.kernel.org/r/20230114001556.43795-2-vishal.moola@gmail.com
Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/khugepaged.c

index d7b993e537116f323dfd913a5dda7db45012e86e..b39ab219d5b7523780c023c5b55efdde8b4871ee 100644 (file)
@@ -507,20 +507,20 @@ static void release_pte_page(struct page *page)
 static void release_pte_pages(pte_t *pte, pte_t *_pte,
                struct list_head *compound_pagelist)
 {
-       struct page *page, *tmp;
+       struct folio *folio, *tmp;
 
        while (--_pte >= pte) {
                pte_t pteval = *_pte;
 
-               page = pte_page(pteval);
+               folio = pfn_folio(pte_pfn(pteval));
                if (!pte_none(pteval) && !is_zero_pfn(pte_pfn(pteval)) &&
-                               !PageCompound(page))
-                       release_pte_page(page);
+                               !folio_test_large(folio))
+                       release_pte_folio(folio);
        }
 
-       list_for_each_entry_safe(page, tmp, compound_pagelist, lru) {
-               list_del(&page->lru);
-               release_pte_page(page);
+       list_for_each_entry_safe(folio, tmp, compound_pagelist, lru) {
+               list_del(&folio->lru);
+               release_pte_folio(folio);
        }
 }