Lines Matching full:page
14 * balloon_page_alloc - allocates a new page for insertion into the balloon
15 * page list.
17 * Driver must call it to properly allocate a new enlisted balloon page.
19 * the guest system. This function returns the page address for the recently
20 * allocated page or NULL in the case we fail to allocate a new page this turn.
22 struct page *balloon_page_alloc(void) in balloon_page_alloc()
24 struct page *page = alloc_page(balloon_mapping_gfp_mask() | in balloon_page_alloc() local
26 return page; in balloon_page_alloc()
31 * balloon_page_enqueue - allocates a new page and inserts it into the balloon
32 * page list.
33 * @b_dev_info: balloon device descriptor where we will insert a new page to
34 * @page: new page to enqueue - allocated using balloon_page_alloc.
36 * Driver must call it to properly enqueue a new allocated balloon page
38 * This function returns the page address for the recently enqueued page or
39 * NULL in the case we fail to allocate a new page this turn.
42 struct page *page) in balloon_page_enqueue() argument
47 * Block others from accessing the 'page' when we get around to in balloon_page_enqueue()
49 * holding a reference to the 'page' at this point. in balloon_page_enqueue()
51 BUG_ON(!trylock_page(page)); in balloon_page_enqueue()
53 balloon_page_insert(b_dev_info, page); in balloon_page_enqueue()
56 unlock_page(page); in balloon_page_enqueue()
61 * balloon_page_dequeue - removes a page from balloon's page list and returns
62 * the its address to allow the driver release the page.
63 * @b_dev_info: balloon device decriptor where we will grab a page from.
65 * Driver must call it to properly de-allocate a previous enlisted balloon page
67 * This function returns the page address for the recently dequeued page or
68 * NULL in the case we find balloon's page list temporarily empty due to
71 struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info) in balloon_page_dequeue()
73 struct page *page, *tmp; in balloon_page_dequeue() local
79 list_for_each_entry_safe(page, tmp, &b_dev_info->pages, lru) { in balloon_page_dequeue()
81 * Block others from accessing the 'page' while we get around in balloon_page_dequeue()
82 * establishing additional references and preparing the 'page' in balloon_page_dequeue()
85 if (trylock_page(page)) { in balloon_page_dequeue()
87 if (PageIsolated(page)) { in balloon_page_dequeue()
89 unlock_page(page); in balloon_page_dequeue()
93 balloon_page_delete(page); in balloon_page_dequeue()
95 unlock_page(page); in balloon_page_dequeue()
104 * If we are unable to dequeue a balloon page because the page in balloon_page_dequeue()
115 page = NULL; in balloon_page_dequeue()
117 return page; in balloon_page_dequeue()
123 bool balloon_page_isolate(struct page *page, isolate_mode_t mode) in balloon_page_isolate() argument
126 struct balloon_dev_info *b_dev_info = balloon_page_device(page); in balloon_page_isolate()
130 list_del(&page->lru); in balloon_page_isolate()
137 void balloon_page_putback(struct page *page) in balloon_page_putback() argument
139 struct balloon_dev_info *b_dev_info = balloon_page_device(page); in balloon_page_putback()
143 list_add(&page->lru, &b_dev_info->pages); in balloon_page_putback()
149 /* move_to_new_page() counterpart for a ballooned page */
151 struct page *newpage, struct page *page, in balloon_page_migrate() argument
154 struct balloon_dev_info *balloon = balloon_page_device(page); in balloon_page_migrate()
164 VM_BUG_ON_PAGE(!PageLocked(page), page); in balloon_page_migrate()
167 return balloon->migratepage(balloon, newpage, page, mode); in balloon_page_migrate()