Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: remove PageUnevictable

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/20240821193445.2294269-6-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
cb29e794 32f51ead

+11 -11
+3 -3
include/linux/page-flags.h
··· 580 580 FOLIO_FLAG_FALSE(swapcache) 581 581 #endif 582 582 583 - PAGEFLAG(Unevictable, unevictable, PF_HEAD) 584 - __CLEARPAGEFLAG(Unevictable, unevictable, PF_HEAD) 585 - TESTCLEARFLAG(Unevictable, unevictable, PF_HEAD) 583 + FOLIO_FLAG(unevictable, FOLIO_HEAD_PAGE) 584 + __FOLIO_CLEAR_FLAG(unevictable, FOLIO_HEAD_PAGE) 585 + FOLIO_TEST_CLEAR_FLAG(unevictable, FOLIO_HEAD_PAGE) 586 586 587 587 #ifdef CONFIG_MMU 588 588 PAGEFLAG(Mlocked, mlocked, PF_NO_TAIL)
+8 -8
mm/huge_memory.c
··· 2932 2932 } 2933 2933 } 2934 2934 2935 - static void lru_add_page_tail(struct page *head, struct page *tail, 2935 + static void lru_add_page_tail(struct folio *folio, struct page *tail, 2936 2936 struct lruvec *lruvec, struct list_head *list) 2937 2937 { 2938 - VM_BUG_ON_PAGE(!PageHead(head), head); 2939 - VM_BUG_ON_PAGE(PageLRU(tail), head); 2938 + VM_BUG_ON_FOLIO(!folio_test_large(folio), folio); 2939 + VM_BUG_ON_FOLIO(PageLRU(tail), folio); 2940 2940 lockdep_assert_held(&lruvec->lru_lock); 2941 2941 2942 2942 if (list) { 2943 2943 /* page reclaim is reclaiming a huge page */ 2944 - VM_WARN_ON(PageLRU(head)); 2944 + VM_WARN_ON(folio_test_lru(folio)); 2945 2945 get_page(tail); 2946 2946 list_add_tail(&tail->lru, list); 2947 2947 } else { 2948 2948 /* head is still on lru (and we have it frozen) */ 2949 - VM_WARN_ON(!PageLRU(head)); 2950 - if (PageUnevictable(tail)) 2949 + VM_WARN_ON(!folio_test_lru(folio)); 2950 + if (folio_test_unevictable(folio)) 2951 2951 tail->mlock_count = 0; 2952 2952 else 2953 - list_add_tail(&tail->lru, &head->lru); 2953 + list_add_tail(&tail->lru, &folio->lru); 2954 2954 SetPageLRU(tail); 2955 2955 } 2956 2956 } ··· 3049 3049 * pages to show after the currently processed elements - e.g. 3050 3050 * migrate_pages 3051 3051 */ 3052 - lru_add_page_tail(head, page_tail, lruvec, list); 3052 + lru_add_page_tail(folio, page_tail, lruvec, list); 3053 3053 } 3054 3054 3055 3055 static void __split_huge_page(struct page *page, struct list_head *list,