Lines Matching refs:page
80 static int swsusp_page_is_free(struct page *);
81 static void swsusp_set_page_forbidden(struct page *);
82 static void swsusp_unset_page_forbidden(struct page *);
192 static struct page *alloc_image_page(gfp_t gfp_mask) in alloc_image_page()
194 struct page *page; in alloc_image_page() local
196 page = alloc_page(gfp_mask); in alloc_image_page()
197 if (page) { in alloc_image_page()
198 swsusp_set_page_forbidden(page); in alloc_image_page()
199 swsusp_set_page_free(page); in alloc_image_page()
201 return page; in alloc_image_page()
222 struct page *page; in free_image_page() local
226 page = virt_to_page(addr); in free_image_page()
228 swsusp_unset_page_forbidden(page); in free_image_page()
230 swsusp_unset_page_free(page); in free_image_page()
232 __free_page(page); in free_image_page()
1000 void swsusp_set_page_free(struct page *page) in swsusp_set_page_free() argument
1003 memory_bm_set_bit(free_pages_map, page_to_pfn(page)); in swsusp_set_page_free()
1006 static int swsusp_page_is_free(struct page *page) in swsusp_page_is_free() argument
1009 memory_bm_test_bit(free_pages_map, page_to_pfn(page)) : 0; in swsusp_page_is_free()
1012 void swsusp_unset_page_free(struct page *page) in swsusp_unset_page_free() argument
1015 memory_bm_clear_bit(free_pages_map, page_to_pfn(page)); in swsusp_unset_page_free()
1018 static void swsusp_set_page_forbidden(struct page *page) in swsusp_set_page_forbidden() argument
1021 memory_bm_set_bit(forbidden_pages_map, page_to_pfn(page)); in swsusp_set_page_forbidden()
1024 int swsusp_page_is_forbidden(struct page *page) in swsusp_page_is_forbidden() argument
1027 memory_bm_test_bit(forbidden_pages_map, page_to_pfn(page)) : 0; in swsusp_page_is_forbidden()
1030 static void swsusp_unset_page_forbidden(struct page *page) in swsusp_unset_page_forbidden() argument
1033 memory_bm_clear_bit(forbidden_pages_map, page_to_pfn(page)); in swsusp_unset_page_forbidden()
1219 static struct page *saveable_highmem_page(struct zone *zone, unsigned long pfn) in saveable_highmem_page()
1221 struct page *page; in saveable_highmem_page() local
1226 page = pfn_to_online_page(pfn); in saveable_highmem_page()
1227 if (!page || page_zone(page) != zone) in saveable_highmem_page()
1230 BUG_ON(!PageHighMem(page)); in saveable_highmem_page()
1232 if (swsusp_page_is_forbidden(page) || swsusp_page_is_free(page)) in saveable_highmem_page()
1235 if (PageReserved(page) || PageOffline(page)) in saveable_highmem_page()
1238 if (page_is_guard(page)) in saveable_highmem_page()
1241 return page; in saveable_highmem_page()
1283 static struct page *saveable_page(struct zone *zone, unsigned long pfn) in saveable_page()
1285 struct page *page; in saveable_page() local
1290 page = pfn_to_online_page(pfn); in saveable_page()
1291 if (!page || page_zone(page) != zone) in saveable_page()
1294 BUG_ON(PageHighMem(page)); in saveable_page()
1296 if (swsusp_page_is_forbidden(page) || swsusp_page_is_free(page)) in saveable_page()
1299 if (PageOffline(page)) in saveable_page()
1302 if (PageReserved(page) in saveable_page()
1303 && (!kernel_page_present(page) || pfn_is_nosave(pfn))) in saveable_page()
1306 if (page_is_guard(page)) in saveable_page()
1309 return page; in saveable_page()
1354 static void safe_copy_page(void *dst, struct page *s_page) in safe_copy_page()
1366 static inline struct page *page_is_saveable(struct zone *zone, unsigned long pfn) in page_is_saveable()
1374 struct page *s_page, *d_page; in copy_data_page()
1491 struct page *page = pfn_to_page(fr_pfn); in swsusp_free() local
1495 hibernate_restore_unprotect_page(page_address(page)); in swsusp_free()
1496 __free_page(page); in swsusp_free()
1526 struct page *page; in preallocate_image_pages() local
1528 page = alloc_image_page(mask); in preallocate_image_pages()
1529 if (!page) in preallocate_image_pages()
1531 memory_bm_set_bit(©_bm, page_to_pfn(page)); in preallocate_image_pages()
1532 if (PageHighMem(page)) in preallocate_image_pages()
1628 struct page *page = pfn_to_page(pfn); in free_unnecessary_pages() local
1630 if (PageHighMem(page)) { in free_unnecessary_pages()
1642 swsusp_unset_page_forbidden(page); in free_unnecessary_pages()
1643 swsusp_unset_page_free(page); in free_unnecessary_pages()
1644 __free_page(page); in free_unnecessary_pages()
1920 struct page *page; in alloc_highmem_pages() local
1922 page = alloc_image_page(__GFP_HIGHMEM|__GFP_KSWAPD_RECLAIM); in alloc_highmem_pages()
1923 memory_bm_set_bit(bm, page_to_pfn(page)); in alloc_highmem_pages()
1959 struct page *page; in swsusp_alloc() local
1961 page = alloc_image_page(GFP_ATOMIC); in swsusp_alloc()
1962 if (!page) in swsusp_alloc()
1964 memory_bm_set_bit(copy_bm, page_to_pfn(page)); in swsusp_alloc()
2119 struct page *page; in snapshot_read_next() local
2121 page = pfn_to_page(memory_bm_next_pfn(©_bm)); in snapshot_read_next()
2122 if (PageHighMem(page)) { in snapshot_read_next()
2130 kaddr = kmap_atomic(page); in snapshot_read_next()
2135 handle->buffer = page_address(page); in snapshot_read_next()
2244 struct page *copy_page; /* data is here now */
2245 struct page *orig_page; /* data was here before the suspend */
2315 struct page *page; in prepare_highmem_image() local
2317 page = alloc_page(__GFP_HIGHMEM); in prepare_highmem_image()
2318 if (!swsusp_page_is_free(page)) { in prepare_highmem_image()
2320 memory_bm_set_bit(bm, page_to_pfn(page)); in prepare_highmem_image()
2324 swsusp_set_page_forbidden(page); in prepare_highmem_image()
2325 swsusp_set_page_free(page); in prepare_highmem_image()
2332 static struct page *last_highmem_page;
2352 static void *get_highmem_page_buffer(struct page *page, in get_highmem_page_buffer() argument
2358 if (swsusp_page_is_forbidden(page) && swsusp_page_is_free(page)) { in get_highmem_page_buffer()
2363 last_highmem_page = page; in get_highmem_page_buffer()
2375 pbe->orig_page = page; in get_highmem_page_buffer()
2377 struct page *tmp; in get_highmem_page_buffer()
2434 static inline void *get_highmem_page_buffer(struct page *page, in get_highmem_page_buffer() argument
2541 struct page *page; in get_buffer() local
2547 page = pfn_to_page(pfn); in get_buffer()
2548 if (PageHighMem(page)) in get_buffer()
2549 return get_highmem_page_buffer(page, ca); in get_buffer()
2551 if (swsusp_page_is_forbidden(page) && swsusp_page_is_free(page)) in get_buffer()
2556 return page_address(page); in get_buffer()
2567 pbe->orig_address = page_address(page); in get_buffer()
2691 static inline void swap_two_pages_data(struct page *p1, struct page *p2, in swap_two_pages_data()