Lines Matching full:page

15 				     struct page *page)  in balloon_page_enqueue_one()  argument
18 * Block others from accessing the 'page' when we get around to in balloon_page_enqueue_one()
20 * holding a reference to the 'page' at this point. If we are not, then in balloon_page_enqueue_one()
23 BUG_ON(!trylock_page(page)); in balloon_page_enqueue_one()
24 balloon_page_insert(b_dev_info, page); in balloon_page_enqueue_one()
25 unlock_page(page); in balloon_page_enqueue_one()
30 * balloon_page_list_enqueue() - inserts a list of pages into the balloon page
32 * @b_dev_info: balloon device descriptor where we will insert a new page to
43 struct page *page, *tmp; in balloon_page_list_enqueue() local
48 list_for_each_entry_safe(page, tmp, pages, lru) { in balloon_page_list_enqueue()
49 list_del(&page->lru); in balloon_page_list_enqueue()
50 balloon_page_enqueue_one(b_dev_info, page); in balloon_page_list_enqueue()
59 * balloon_page_list_dequeue() - removes pages from balloon's page list and
61 * @b_dev_info: balloon device descriptor where we will grab a page from.
71 * isn't empty - since the page list can be temporarily empty due to compaction
79 struct page *page, *tmp; in balloon_page_list_dequeue() local
84 list_for_each_entry_safe(page, tmp, &b_dev_info->pages, lru) { in balloon_page_list_dequeue()
89 * Block others from accessing the 'page' while we get around to in balloon_page_list_dequeue()
90 * establishing additional references and preparing the 'page' in balloon_page_list_dequeue()
93 if (!trylock_page(page)) in balloon_page_list_dequeue()
97 PageIsolated(page)) { in balloon_page_list_dequeue()
99 unlock_page(page); in balloon_page_list_dequeue()
102 balloon_page_delete(page); in balloon_page_list_dequeue()
104 list_add(&page->lru, pages); in balloon_page_list_dequeue()
105 unlock_page(page); in balloon_page_list_dequeue()
115 * balloon_page_alloc - allocates a new page for insertion into the balloon
116 * page list.
118 * Driver must call this function to properly allocate a new balloon page.
119 * Driver must call balloon_page_enqueue before definitively removing the page
122 * Return: struct page for the allocated page or NULL on allocation failure.
124 struct page *balloon_page_alloc(void) in balloon_page_alloc()
126 struct page *page = alloc_page(balloon_mapping_gfp_mask() | in balloon_page_alloc() local
129 return page; in balloon_page_alloc()
134 * balloon_page_enqueue - inserts a new page into the balloon page list.
136 * @b_dev_info: balloon device descriptor where we will insert a new page
137 * @page: new page to enqueue - allocated using balloon_page_alloc.
140 * page before definitively removing the page from the guest system.
147 struct page *page) in balloon_page_enqueue() argument
152 balloon_page_enqueue_one(b_dev_info, page); in balloon_page_enqueue()
158 * balloon_page_dequeue - removes a page from balloon's page list and returns
159 * its address to allow the driver to release the page.
160 * @b_dev_info: balloon device descriptor where we will grab a page from.
162 * Driver must call this function to properly dequeue a previously enqueued page
169 * some enqueued pages - since the page list can be temporarily empty due to
175 * Return: struct page for the dequeued page, or NULL if no page was dequeued.
177 struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info) in balloon_page_dequeue()
187 * If we are unable to dequeue a balloon page because the page in balloon_page_dequeue()
200 return list_first_entry(&pages, struct page, lru); in balloon_page_dequeue()
206 static bool balloon_page_isolate(struct page *page, isolate_mode_t mode) in balloon_page_isolate() argument
209 struct balloon_dev_info *b_dev_info = balloon_page_device(page); in balloon_page_isolate()
213 list_del(&page->lru); in balloon_page_isolate()
220 static void balloon_page_putback(struct page *page) in balloon_page_putback() argument
222 struct balloon_dev_info *b_dev_info = balloon_page_device(page); in balloon_page_putback()
226 list_add(&page->lru, &b_dev_info->pages); in balloon_page_putback()
231 /* move_to_new_page() counterpart for a ballooned page */
232 static int balloon_page_migrate(struct page *newpage, struct page *page, in balloon_page_migrate() argument
235 struct balloon_dev_info *balloon = balloon_page_device(page); in balloon_page_migrate()
237 VM_BUG_ON_PAGE(!PageLocked(page), page); in balloon_page_migrate()
240 return balloon->migratepage(balloon, newpage, page, mode); in balloon_page_migrate()