Skip to content

Commit

Permalink
mm/khugepaged: convert release_pte_pages() to use folios
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vishal Moola (Oracle) authored and Andrew Morton committed Feb 3, 2023
1 parent 92644f5 commit 9bdfeea
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mm/khugepaged.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 9bdfeea

Please sign in to comment.