Skip to content

Commit

Permalink
mm: remove PageUnevictable
Browse files Browse the repository at this point in the history
There is only one caller of PageUnevictable() left; convert it to call
folio_test_unevictable() and remove all the page accessors.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) authored and akpm00 committed Sep 4, 2024
1 parent 32f51ea commit cb29e79
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions include/linux/page-flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,9 @@ FOLIO_CLEAR_FLAG(swapcache, FOLIO_HEAD_PAGE)
FOLIO_FLAG_FALSE(swapcache)
#endif

PAGEFLAG(Unevictable, unevictable, PF_HEAD)
__CLEARPAGEFLAG(Unevictable, unevictable, PF_HEAD)
TESTCLEARFLAG(Unevictable, unevictable, PF_HEAD)
FOLIO_FLAG(unevictable, FOLIO_HEAD_PAGE)
__FOLIO_CLEAR_FLAG(unevictable, FOLIO_HEAD_PAGE)
FOLIO_TEST_CLEAR_FLAG(unevictable, FOLIO_HEAD_PAGE)

#ifdef CONFIG_MMU
PAGEFLAG(Mlocked, mlocked, PF_NO_TAIL)
Expand Down
16 changes: 8 additions & 8 deletions mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -2932,25 +2932,25 @@ static void remap_page(struct folio *folio, unsigned long nr)
}
}

static void lru_add_page_tail(struct page *head, struct page *tail,
static void lru_add_page_tail(struct folio *folio, struct page *tail,
struct lruvec *lruvec, struct list_head *list)
{
VM_BUG_ON_PAGE(!PageHead(head), head);
VM_BUG_ON_PAGE(PageLRU(tail), head);
VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);
VM_BUG_ON_FOLIO(PageLRU(tail), folio);
lockdep_assert_held(&lruvec->lru_lock);

if (list) {
/* page reclaim is reclaiming a huge page */
VM_WARN_ON(PageLRU(head));
VM_WARN_ON(folio_test_lru(folio));
get_page(tail);
list_add_tail(&tail->lru, list);
} else {
/* head is still on lru (and we have it frozen) */
VM_WARN_ON(!PageLRU(head));
if (PageUnevictable(tail))
VM_WARN_ON(!folio_test_lru(folio));
if (folio_test_unevictable(folio))
tail->mlock_count = 0;
else
list_add_tail(&tail->lru, &head->lru);
list_add_tail(&tail->lru, &folio->lru);
SetPageLRU(tail);
}
}
Expand Down Expand Up @@ -3049,7 +3049,7 @@ static void __split_huge_page_tail(struct folio *folio, int tail,
* pages to show after the currently processed elements - e.g.
* migrate_pages
*/
lru_add_page_tail(head, page_tail, lruvec, list);
lru_add_page_tail(folio, page_tail, lruvec, list);
}

static void __split_huge_page(struct page *page, struct list_head *list,
Expand Down

0 comments on commit cb29e79

Please sign in to comment.