Lines Matching full:pages

8  * acts like a "balloon" that can be inflated to reclaim physical pages by
10 * freeing up the underlying machine pages so they can be allocated to
52 /* Maximum number of refused pages we accumulate during inflation cycle */
148 * ballooned pages (up to 512).
150 * pages that are about to be deflated from the
153 * for 2MB pages.
156 * pages.
241 struct list_head pages; member
316 * @batch_max_pages: maximum pages that can be locked/unlocked.
318 * Indicates the number of pages that the hypervisor can lock or unlock
361 * @huge_pages - list of the inflated 2MB pages.
407 /* allocation statistics for huge and small pages */
538 * 2MB pages are only supported with batching. If batching is for some in vmballoon_send_start()
539 * reason disabled, do not use 2MB pages, since otherwise the legacy in vmballoon_send_start()
540 * mechanism is used with 2MB pages, causing a failure. in vmballoon_send_start()
654 * vmballoon_alloc_page_list - allocates a list of pages.
658 * @req_n_pages: the number of requested pages.
660 * Tries to allocate @req_n_pages. Add them to the list of balloon pages in
661 * @ctl.pages and updates @ctl.n_pages to reflect the number of pages.
674 * First check if we happen to have pages that were allocated in vmballoon_alloc_page_list()
676 * by the hypervisor, and then split into 4KB pages. in vmballoon_alloc_page_list()
695 list_add(&page->lru, &ctl->pages); in vmballoon_alloc_page_list()
772 * vmballoon_lock_op - notifies the host about inflated/deflated pages.
774 * @num_pages: number of inflated/deflated pages.
780 * stop using them since the VM does). Host may reject some pages, we need to
781 * check the return value and maybe submit a different page. The pages that are
841 * vmballoon_lock - lock or unlock a batch of pages.
846 * Notifies the host of about ballooned pages (after inflation or deflation,
849 * next size of pages.
852 * pages list. Instead we queue it for later processing. We do that for several
855 * caller will check if there are too many refused pages and release them.
873 list_for_each_entry(page, &ctl->pages, lru) in vmballoon_lock()
880 * Iterate over the pages in the provided list. Since we are changing in vmballoon_lock()
902 * Error happened. Move the pages to the refused list and update in vmballoon_lock()
903 * the pages number. in vmballoon_lock()
918 * @page_list: list of pages to release.
919 * @n_pages: pointer to the number of pages.
920 * @page_size: whether the pages in the list are 2MB (or else 4KB).
922 * Releases the list of pages and zeros the number of pages.
941 * Release pages that were allocated while attempting to inflate the
990 * vmballoon_enqueue_page_list() - Enqueues list of pages after inflation.
993 * @pages: list of pages to enqueue.
994 * @n_pages: pointer to number of pages in list. The value is zeroed.
995 * @page_size: whether the pages are 2MB or 4KB pages.
997 * Enqueues the provides list of pages in the ballooned page list, clears the
998 * list and zeroes the number of pages that was provided.
1001 struct list_head *pages, in vmballoon_enqueue_page_list() argument
1009 balloon_page_list_enqueue(&b->b_dev_info, pages); in vmballoon_enqueue_page_list()
1012 * Keep the huge pages in a local list which is not available in vmballoon_enqueue_page_list()
1017 list_for_each_entry(page, pages, lru) { in vmballoon_enqueue_page_list()
1021 list_splice_init(pages, &b->huge_pages); in vmballoon_enqueue_page_list()
1034 * @pages: list of pages to enqueue.
1035 * @n_pages: pointer to number of pages in list. The value is zeroed.
1036 * @page_size: whether the pages are 2MB or 4KB pages.
1037 * @n_req_pages: the number of requested pages.
1039 * Dequeues the number of requested pages from the balloon for deflation. The
1040 * number of dequeued pages may be lower, if not enough pages in the requested
1044 struct list_head *pages, in vmballoon_dequeue_page_list() argument
1053 /* In the case of 4k pages, use the compaction infrastructure */ in vmballoon_dequeue_page_list()
1055 *n_pages = balloon_page_list_dequeue(&b->b_dev_info, pages, in vmballoon_dequeue_page_list()
1060 /* 2MB pages */ in vmballoon_dequeue_page_list()
1065 list_move(&page->lru, pages); in vmballoon_dequeue_page_list()
1077 * vmballoon_split_refused_pages() - Split the 2MB refused pages to 4k.
1079 * If inflation of 2MB pages was denied by the hypervisor, it is likely to be
1080 * due to one or few 4KB pages. These 2MB pages may keep being allocated and
1082 * pages into 4KB pages and adds them into @prealloc_pages list.
1111 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_inflate()
1122 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_inflate()
1135 /* Actually lock the pages by telling the hypervisor */ in vmballoon_inflate()
1148 vmballoon_enqueue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_inflate()
1152 * If allocation failed or the number of refused pages exceeds in vmballoon_inflate()
1161 * Split the refused pages to 4k. This will also empty in vmballoon_inflate()
1162 * the refused pages list. in vmballoon_inflate()
1172 * Release pages that were allocated while attempting to inflate the in vmballoon_inflate()
1200 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_deflate()
1206 /* free pages to reach target */ in vmballoon_deflate()
1215 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_deflate()
1240 /* First take the pages from the balloon pages. */ in vmballoon_deflate()
1241 vmballoon_dequeue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1245 * Before pages are moving to the refused list, count their in vmballoon_deflate()
1251 * Unlock the pages by communicating with the hypervisor if the in vmballoon_deflate()
1253 * return code. Instead we check if all the pages we manage to in vmballoon_deflate()
1254 * unlock all the pages. If we failed, we will move to the next in vmballoon_deflate()
1263 * place now, as once the pages are released, the number of in vmballoon_deflate()
1264 * pages is zeroed. in vmballoon_deflate()
1276 /* free the ballooned pages */ in vmballoon_deflate()
1277 vmballoon_release_page_list(&ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1280 /* Return the refused pages to the ballooned list. */ in vmballoon_deflate()
1285 /* If we failed to unlock all the pages, move to next size. */ in vmballoon_deflate()
1404 * vmballoon_pop - Quickly release all pages allocate for the balloon.
1410 * pages being released.
1433 /* free all pages, skipping monitor unlock */ in vmballoon_reset()
1523 * Returns: number of pages that were freed during deflation.
1560 * vmballoon_shrinker_count() - return the number of ballooned pages.
1564 * Returns: number of 4k pages that are allocated for the balloon and can
1988 * additional spurious resets from guest touching deallocated pages. in vmballoon_exit()