Skip to content

Commit

Permalink
Revert "mm: convert destroy_compound_page() to destroy_large_folio()"
Browse files Browse the repository at this point in the history
This reverts commit d3b90b7.
  • Loading branch information
sfrothwell committed Jun 21, 2022
1 parent 0763336 commit 286c6c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -923,12 +923,10 @@ static inline void set_compound_page_dtor(struct page *page,
page[1].compound_dtor = compound_dtor;
}

static inline void destroy_large_folio(struct folio *folio)
static inline void destroy_compound_page(struct page *page)
{
enum compound_dtor_id dtor = folio_page(folio, 1)->compound_dtor;

VM_BUG_ON_FOLIO(dtor >= NR_COMPOUND_DTORS, folio);
compound_page_dtors[dtor](&folio->page);
VM_BUG_ON_PAGE(page[1].compound_dtor >= NR_COMPOUND_DTORS, page);
compound_page_dtors[page[1].compound_dtor](page);
}

static inline int head_compound_pincount(struct page *head)
Expand Down
2 changes: 1 addition & 1 deletion mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static void __folio_put_large(struct folio *folio)
*/
if (!folio_test_hugetlb(folio))
__page_cache_release(folio);
destroy_large_folio(folio);
destroy_compound_page(&folio->page);
}

void __folio_put(struct folio *folio)
Expand Down
4 changes: 2 additions & 2 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,7 @@ static unsigned int shrink_page_list(struct list_head *page_list,
* appear not as the counts should be low
*/
if (unlikely(folio_test_large(folio)))
destroy_large_folio(folio);
destroy_compound_page(&folio->page);
else
list_add(&folio->lru, &free_pages);
continue;
Expand Down Expand Up @@ -2354,7 +2354,7 @@ static unsigned int move_pages_to_lru(struct lruvec *lruvec,

if (unlikely(folio_test_large(folio))) {
spin_unlock_irq(&lruvec->lru_lock);
destroy_large_folio(folio);
destroy_compound_page(&folio->page);
spin_lock_irq(&lruvec->lru_lock);
} else
list_add(&folio->lru, &folios_to_free);
Expand Down

0 comments on commit 286c6c7

Please sign in to comment.