Lines Matching refs:page
36 struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER); in crst_table_alloc() local
38 if (!page) in crst_table_alloc()
40 return (unsigned long *) page_to_phys(page); in crst_table_alloc()
150 struct page *page; in gmap_alloc() local
179 page = alloc_pages(GFP_KERNEL, ALLOC_ORDER); in gmap_alloc()
180 if (!page) in gmap_alloc()
182 page->index = 0; in gmap_alloc()
183 list_add(&page->lru, &gmap->crst_list); in gmap_alloc()
184 table = (unsigned long *) page_to_phys(page); in gmap_alloc()
240 struct page *page, *next; in gmap_free() local
249 list_for_each_entry_safe(page, next, &gmap->crst_list, lru) in gmap_free()
250 __free_pages(page, ALLOC_ORDER); in gmap_free()
286 struct page *page; in gmap_alloc_table() local
290 page = alloc_pages(GFP_KERNEL, ALLOC_ORDER); in gmap_alloc_table()
291 if (!page) in gmap_alloc_table()
293 new = (unsigned long *) page_to_phys(page); in gmap_alloc_table()
297 list_add(&page->lru, &gmap->crst_list); in gmap_alloc_table()
300 page->index = gaddr; in gmap_alloc_table()
301 page = NULL; in gmap_alloc_table()
304 if (page) in gmap_alloc_table()
305 __free_pages(page, ALLOC_ORDER); in gmap_alloc_table()
317 struct page *page; in __gmap_segment_gaddr() local
323 page = virt_to_page((void *)((unsigned long) entry & mask)); in __gmap_segment_gaddr()
324 return page->index + offset; in __gmap_segment_gaddr()
611 struct page *page = migration_entry_to_page(entry); in gmap_zap_swap_entry() local
613 if (PageAnon(page)) in gmap_zap_swap_entry()
798 static inline int page_table_with_pgste(struct page *page) in page_table_with_pgste() argument
800 return atomic_read(&page->_mapcount) == 0; in page_table_with_pgste()
805 struct page *page; in page_table_alloc_pgste() local
808 page = alloc_page(GFP_KERNEL|__GFP_REPEAT); in page_table_alloc_pgste()
809 if (!page) in page_table_alloc_pgste()
811 if (!pgtable_page_ctor(page)) { in page_table_alloc_pgste()
812 __free_page(page); in page_table_alloc_pgste()
815 atomic_set(&page->_mapcount, 0); in page_table_alloc_pgste()
816 table = (unsigned long *) page_to_phys(page); in page_table_alloc_pgste()
824 struct page *page; in page_table_free_pgste() local
826 page = pfn_to_page(__pa(table) >> PAGE_SHIFT); in page_table_free_pgste()
827 pgtable_page_dtor(page); in page_table_free_pgste()
828 atomic_set(&page->_mapcount, -1); in page_table_free_pgste()
829 __free_page(page); in page_table_free_pgste()
960 static inline int page_table_with_pgste(struct page *page) in page_table_with_pgste() argument
998 struct page *uninitialized_var(page); in page_table_alloc()
1007 page = list_first_entry(&mm->context.pgtable_list, in page_table_alloc()
1008 struct page, lru); in page_table_alloc()
1009 table = (unsigned long *) page_to_phys(page); in page_table_alloc()
1010 mask = atomic_read(&page->_mapcount); in page_table_alloc()
1015 page = alloc_page(GFP_KERNEL|__GFP_REPEAT); in page_table_alloc()
1016 if (!page) in page_table_alloc()
1018 if (!pgtable_page_ctor(page)) { in page_table_alloc()
1019 __free_page(page); in page_table_alloc()
1022 atomic_set(&page->_mapcount, 1); in page_table_alloc()
1023 table = (unsigned long *) page_to_phys(page); in page_table_alloc()
1026 list_add(&page->lru, &mm->context.pgtable_list); in page_table_alloc()
1030 mask = atomic_xor_bits(&page->_mapcount, bit); in page_table_alloc()
1032 list_del(&page->lru); in page_table_alloc()
1040 struct page *page; in page_table_free() local
1043 page = pfn_to_page(__pa(table) >> PAGE_SHIFT); in page_table_free()
1044 if (page_table_with_pgste(page)) in page_table_free()
1049 if ((atomic_read(&page->_mapcount) & FRAG_MASK) != FRAG_MASK) in page_table_free()
1050 list_del(&page->lru); in page_table_free()
1051 mask = atomic_xor_bits(&page->_mapcount, bit); in page_table_free()
1053 list_add(&page->lru, &mm->context.pgtable_list); in page_table_free()
1056 pgtable_page_dtor(page); in page_table_free()
1057 atomic_set(&page->_mapcount, -1); in page_table_free()
1058 __free_page(page); in page_table_free()
1064 struct page *page; in __page_table_free_rcu() local
1069 page = pfn_to_page(__pa(table) >> PAGE_SHIFT); in __page_table_free_rcu()
1070 if (atomic_xor_bits(&page->_mapcount, bit) == 0) { in __page_table_free_rcu()
1071 pgtable_page_dtor(page); in __page_table_free_rcu()
1072 atomic_set(&page->_mapcount, -1); in __page_table_free_rcu()
1073 __free_page(page); in __page_table_free_rcu()
1081 struct page *page; in page_table_free_rcu() local
1085 page = pfn_to_page(__pa(table) >> PAGE_SHIFT); in page_table_free_rcu()
1086 if (page_table_with_pgste(page)) { in page_table_free_rcu()
1094 if ((atomic_read(&page->_mapcount) & FRAG_MASK) != FRAG_MASK) in page_table_free_rcu()
1095 list_del(&page->lru); in page_table_free_rcu()
1096 mask = atomic_xor_bits(&page->_mapcount, bit | (bit << 4)); in page_table_free_rcu()
1098 list_add_tail(&page->lru, &mm->context.pgtable_list); in page_table_free_rcu()