Lines Matching defs:page

15 				     struct page *page)
18 * Block others from accessing the 'page' when we get around to
20 * holding a reference to the 'page' at this point. If we are not, then
23 BUG_ON(!trylock_page(page));
24 balloon_page_insert(b_dev_info, page);
25 unlock_page(page);
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;
48 list_for_each_entry_safe(page, tmp, pages, lru) {
49 list_del(&page->lru);
50 balloon_page_enqueue_one(b_dev_info, page);
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;
84 list_for_each_entry_safe(page, tmp, &b_dev_info->pages, lru) {
89 * Block others from accessing the 'page' while we get around to
90 * establishing additional references and preparing the 'page'
93 if (!trylock_page(page))
97 PageIsolated(page)) {
99 unlock_page(page);
102 balloon_page_delete(page);
104 list_add(&page->lru, pages);
105 unlock_page(page);
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)
126 struct page *page = alloc_page(balloon_mapping_gfp_mask() |
129 return page;
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)
152 balloon_page_enqueue_one(b_dev_info, page);
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)
187 * If we are unable to dequeue a balloon page because the page
200 return list_first_entry(&pages, struct page, lru);
206 static bool balloon_page_isolate(struct page *page, isolate_mode_t mode)
209 struct balloon_dev_info *b_dev_info = balloon_page_device(page);
213 list_del(&page->lru);
220 static void balloon_page_putback(struct page *page)
222 struct balloon_dev_info *b_dev_info = balloon_page_device(page);
226 list_add(&page->lru, &b_dev_info->pages);
231 /* move_to_new_page() counterpart for a ballooned page */
232 static int balloon_page_migrate(struct page *newpage, struct page *page,
235 struct balloon_dev_info *balloon = balloon_page_device(page);
245 VM_BUG_ON_PAGE(!PageLocked(page), page);
248 return balloon->migratepage(balloon, newpage, page, mode);