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
51 /* Maximum number of refused pages we accumulate during inflation cycle */
147 * ballooned pages (up to 512).
149 * pages that are about to be deflated from the
152 * for 2MB pages.
155 * pages.
240 struct list_head pages; member
315 * @batch_max_pages: maximum pages that can be locked/unlocked.
317 * Indicates the number of pages that the hypervisor can lock or unlock
355 * @huge_pages - list of the inflated 2MB pages.
401 /* allocation statistics for huge and small pages */
532 * 2MB pages are only supported with batching. If batching is for some in vmballoon_send_start()
533 * reason disabled, do not use 2MB pages, since otherwise the legacy in vmballoon_send_start()
534 * mechanism is used with 2MB pages, causing a failure. in vmballoon_send_start()
648 * vmballoon_alloc_page_list - allocates a list of pages.
652 * @req_n_pages: the number of requested pages.
654 * Tries to allocate @req_n_pages. Add them to the list of balloon pages in
655 * @ctl.pages and updates @ctl.n_pages to reflect the number of pages.
668 * First check if we happen to have pages that were allocated in vmballoon_alloc_page_list()
670 * by the hypervisor, and then split into 4KB pages. in vmballoon_alloc_page_list()
689 list_add(&page->lru, &ctl->pages); in vmballoon_alloc_page_list()
766 * vmballoon_lock_op - notifies the host about inflated/deflated pages.
768 * @num_pages: number of inflated/deflated pages.
774 * stop using them since the VM does). Host may reject some pages, we need to
775 * check the return value and maybe submit a different page. The pages that are
835 * vmballoon_lock - lock or unlock a batch of pages.
840 * Notifies the host of about ballooned pages (after inflation or deflation,
843 * next size of pages.
846 * pages list. Instead we queue it for later processing. We do that for several
849 * caller will check if there are too many refused pages and release them.
867 list_for_each_entry(page, &ctl->pages, lru) in vmballoon_lock()
874 * Iterate over the pages in the provided list. Since we are changing in vmballoon_lock()
896 * Error happened. Move the pages to the refused list and update in vmballoon_lock()
897 * the pages number. in vmballoon_lock()
912 * @page_list: list of pages to release.
913 * @n_pages: pointer to the number of pages.
914 * @page_size: whether the pages in the list are 2MB (or else 4KB).
916 * Releases the list of pages and zeros the number of pages.
935 * Release pages that were allocated while attempting to inflate the
984 * vmballoon_enqueue_page_list() - Enqueues list of pages after inflation.
987 * @pages: list of pages to enqueue.
988 * @n_pages: pointer to number of pages in list. The value is zeroed.
989 * @page_size: whether the pages are 2MB or 4KB pages.
991 * Enqueues the provides list of pages in the ballooned page list, clears the
992 * list and zeroes the number of pages that was provided.
995 struct list_head *pages, in vmballoon_enqueue_page_list() argument
1003 balloon_page_list_enqueue(&b->b_dev_info, pages); in vmballoon_enqueue_page_list()
1006 * Keep the huge pages in a local list which is not available in vmballoon_enqueue_page_list()
1011 list_for_each_entry(page, pages, lru) { in vmballoon_enqueue_page_list()
1015 list_splice_init(pages, &b->huge_pages); in vmballoon_enqueue_page_list()
1028 * @pages: list of pages to enqueue.
1029 * @n_pages: pointer to number of pages in list. The value is zeroed.
1030 * @page_size: whether the pages are 2MB or 4KB pages.
1031 * @n_req_pages: the number of requested pages.
1033 * Dequeues the number of requested pages from the balloon for deflation. The
1034 * number of dequeued pages may be lower, if not enough pages in the requested
1038 struct list_head *pages, in vmballoon_dequeue_page_list() argument
1047 /* In the case of 4k pages, use the compaction infrastructure */ in vmballoon_dequeue_page_list()
1049 *n_pages = balloon_page_list_dequeue(&b->b_dev_info, pages, in vmballoon_dequeue_page_list()
1054 /* 2MB pages */ in vmballoon_dequeue_page_list()
1059 list_move(&page->lru, pages); in vmballoon_dequeue_page_list()
1071 * vmballoon_split_refused_pages() - Split the 2MB refused pages to 4k.
1073 * If inflation of 2MB pages was denied by the hypervisor, it is likely to be
1074 * due to one or few 4KB pages. These 2MB pages may keep being allocated and
1076 * pages into 4KB pages and adds them into @prealloc_pages list.
1105 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_inflate()
1116 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_inflate()
1129 /* Actually lock the pages by telling the hypervisor */ in vmballoon_inflate()
1142 vmballoon_enqueue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_inflate()
1146 * If allocation failed or the number of refused pages exceeds in vmballoon_inflate()
1155 * Split the refused pages to 4k. This will also empty in vmballoon_inflate()
1156 * the refused pages list. in vmballoon_inflate()
1166 * Release pages that were allocated while attempting to inflate the in vmballoon_inflate()
1194 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_deflate()
1200 /* free pages to reach target */ in vmballoon_deflate()
1209 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_deflate()
1234 /* First take the pages from the balloon pages. */ in vmballoon_deflate()
1235 vmballoon_dequeue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1239 * Before pages are moving to the refused list, count their in vmballoon_deflate()
1245 * Unlock the pages by communicating with the hypervisor if the in vmballoon_deflate()
1247 * return code. Instead we check if all the pages we manage to in vmballoon_deflate()
1248 * unlock all the pages. If we failed, we will move to the next in vmballoon_deflate()
1257 * place now, as once the pages are released, the number of in vmballoon_deflate()
1258 * pages is zeroed. in vmballoon_deflate()
1270 /* free the ballooned pages */ in vmballoon_deflate()
1271 vmballoon_release_page_list(&ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1274 /* Return the refused pages to the ballooned list. */ in vmballoon_deflate()
1279 /* If we failed to unlock all the pages, move to next size. */ in vmballoon_deflate()
1398 * vmballoon_pop - Quickly release all pages allocate for the balloon.
1404 * pages being released.
1427 /* free all pages, skipping monitor unlock */ in vmballoon_reset()
1517 * Returns: number of pages that were freed during deflation.
1554 * vmballoon_shrinker_count() - return the number of ballooned pages.
1558 * Returns: number of 4k pages that are allocated for the balloon and can
1932 * additional spurious resets from guest touching deallocated pages. in vmballoon_exit()