Lines Matching full:page
9 * page_is_file_lru - should the page be on a file LRU or anon LRU?
10 * @page: the page to test
12 * Returns 1 if @page is a regular filesystem backed page cache page or a lazily
13 * freed anonymous page (e.g. via MADV_FREE). Returns 0 if @page is a normal
14 * anonymous page, a tmpfs page or otherwise ram or swap backed page. Used by
15 * functions that manipulate the LRU lists, to sort a page onto the right LRU
18 * We would like to get this info without a page flag, but the state
19 * needs to survive until the page is last deleted from the LRU, which
22 static inline int page_is_file_lru(struct page *page) in page_is_file_lru() argument
24 return !PageSwapBacked(page); in page_is_file_lru()
42 * __clear_page_lru_flags - clear page lru flags before releasing a page
43 * @page: the page that was on lru and now has a zero reference
45 static __always_inline void __clear_page_lru_flags(struct page *page) in __clear_page_lru_flags() argument
47 VM_BUG_ON_PAGE(!PageLRU(page), page); in __clear_page_lru_flags()
49 __ClearPageLRU(page); in __clear_page_lru_flags()
52 if (PageActive(page) && PageUnevictable(page)) in __clear_page_lru_flags()
55 __ClearPageActive(page); in __clear_page_lru_flags()
56 __ClearPageUnevictable(page); in __clear_page_lru_flags()
60 * page_lru - which LRU list should a page be on?
61 * @page: the page to test
63 * Returns the LRU list a page should be on, as an index
66 static __always_inline enum lru_list page_lru(struct page *page) in page_lru() argument
70 VM_BUG_ON_PAGE(PageActive(page) && PageUnevictable(page), page); in page_lru()
72 if (PageUnevictable(page)) in page_lru()
75 lru = page_is_file_lru(page) ? LRU_INACTIVE_FILE : LRU_INACTIVE_ANON; in page_lru()
76 if (PageActive(page)) in page_lru()
82 static __always_inline void add_page_to_lru_list(struct page *page, in add_page_to_lru_list() argument
85 enum lru_list lru = page_lru(page); in add_page_to_lru_list()
87 update_lru_size(lruvec, lru, page_zonenum(page), thp_nr_pages(page)); in add_page_to_lru_list()
88 list_add(&page->lru, &lruvec->lists[lru]); in add_page_to_lru_list()
91 static __always_inline void add_page_to_lru_list_tail(struct page *page, in add_page_to_lru_list_tail() argument
94 enum lru_list lru = page_lru(page); in add_page_to_lru_list_tail()
96 update_lru_size(lruvec, lru, page_zonenum(page), thp_nr_pages(page)); in add_page_to_lru_list_tail()
97 list_add_tail(&page->lru, &lruvec->lists[lru]); in add_page_to_lru_list_tail()
100 static __always_inline void del_page_from_lru_list(struct page *page, in del_page_from_lru_list() argument
103 list_del(&page->lru); in del_page_from_lru_list()
104 update_lru_size(lruvec, page_lru(page), page_zonenum(page), in del_page_from_lru_list()
105 -thp_nr_pages(page)); in del_page_from_lru_list()