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.
392 /* allocation statistics for huge and small pages */
523 * 2MB pages are only supported with batching. If batching is for some in vmballoon_send_start()
524 * reason disabled, do not use 2MB pages, since otherwise the legacy in vmballoon_send_start()
525 * mechanism is used with 2MB pages, causing a failure. in vmballoon_send_start()
639 * vmballoon_alloc_page_list - allocates a list of pages.
643 * @req_n_pages: the number of requested pages.
645 * Tries to allocate @req_n_pages. Add them to the list of balloon pages in
646 * @ctl.pages and updates @ctl.n_pages to reflect the number of pages.
659 * First check if we happen to have pages that were allocated in vmballoon_alloc_page_list()
661 * by the hypervisor, and then split into 4KB pages. in vmballoon_alloc_page_list()
680 list_add(&page->lru, &ctl->pages); in vmballoon_alloc_page_list()
757 * vmballoon_lock_op - notifies the host about inflated/deflated pages.
759 * @num_pages: number of inflated/deflated pages.
765 * stop using them since the VM does). Host may reject some pages, we need to
766 * check the return value and maybe submit a different page. The pages that are
826 * vmballoon_lock - lock or unlock a batch of pages.
831 * Notifies the host of about ballooned pages (after inflation or deflation,
834 * next size of pages.
837 * pages list. Instead we queue it for later processing. We do that for several
840 * caller will check if there are too many refused pages and release them.
858 list_for_each_entry(page, &ctl->pages, lru) in vmballoon_lock()
865 * Iterate over the pages in the provided list. Since we are changing in vmballoon_lock()
887 * Error happened. Move the pages to the refused list and update in vmballoon_lock()
888 * the pages number. in vmballoon_lock()
903 * @page_list: list of pages to release.
904 * @n_pages: pointer to the number of pages.
905 * @page_size: whether the pages in the list are 2MB (or else 4KB).
907 * Releases the list of pages and zeros the number of pages.
926 * Release pages that were allocated while attempting to inflate the
975 * vmballoon_enqueue_page_list() - Enqueues list of pages after inflation.
978 * @pages: list of pages to enqueue.
979 * @n_pages: pointer to number of pages in list. The value is zeroed.
980 * @page_size: whether the pages are 2MB or 4KB pages.
982 * Enqueues the provides list of pages in the ballooned page list, clears the
983 * list and zeroes the number of pages that was provided.
986 struct list_head *pages, in vmballoon_enqueue_page_list() argument
994 balloon_page_list_enqueue(&b->b_dev_info, pages); in vmballoon_enqueue_page_list()
997 * Keep the huge pages in a local list which is not available in vmballoon_enqueue_page_list()
1002 list_for_each_entry(page, pages, lru) { in vmballoon_enqueue_page_list()
1006 list_splice_init(pages, &b->huge_pages); in vmballoon_enqueue_page_list()
1019 * @pages: list of pages to enqueue.
1020 * @n_pages: pointer to number of pages in list. The value is zeroed.
1021 * @page_size: whether the pages are 2MB or 4KB pages.
1022 * @n_req_pages: the number of requested pages.
1024 * Dequeues the number of requested pages from the balloon for deflation. The
1025 * number of dequeued pages may be lower, if not enough pages in the requested
1029 struct list_head *pages, in vmballoon_dequeue_page_list() argument
1038 /* In the case of 4k pages, use the compaction infrastructure */ in vmballoon_dequeue_page_list()
1040 *n_pages = balloon_page_list_dequeue(&b->b_dev_info, pages, in vmballoon_dequeue_page_list()
1045 /* 2MB pages */ in vmballoon_dequeue_page_list()
1050 list_move(&page->lru, pages); in vmballoon_dequeue_page_list()
1062 * vmballoon_split_refused_pages() - Split the 2MB refused pages to 4k.
1064 * If inflation of 2MB pages was denied by the hypervisor, it is likely to be
1065 * due to one or few 4KB pages. These 2MB pages may keep being allocated and
1067 * pages into 4KB pages and adds them into @prealloc_pages list.
1096 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_inflate()
1107 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_inflate()
1120 /* Actually lock the pages by telling the hypervisor */ in vmballoon_inflate()
1133 vmballoon_enqueue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_inflate()
1137 * If allocation failed or the number of refused pages exceeds in vmballoon_inflate()
1146 * Split the refused pages to 4k. This will also empty in vmballoon_inflate()
1147 * the refused pages list. in vmballoon_inflate()
1157 * Release pages that were allocated while attempting to inflate the in vmballoon_inflate()
1185 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_deflate()
1191 /* free pages to reach target */ in vmballoon_deflate()
1200 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_deflate()
1225 /* First take the pages from the balloon pages. */ in vmballoon_deflate()
1226 vmballoon_dequeue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1230 * Before pages are moving to the refused list, count their in vmballoon_deflate()
1236 * Unlock the pages by communicating with the hypervisor if the in vmballoon_deflate()
1238 * return code. Instead we check if all the pages we manage to in vmballoon_deflate()
1239 * unlock all the pages. If we failed, we will move to the next in vmballoon_deflate()
1248 * place now, as once the pages are released, the number of in vmballoon_deflate()
1249 * pages is zeroed. in vmballoon_deflate()
1261 /* free the ballooned pages */ in vmballoon_deflate()
1262 vmballoon_release_page_list(&ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1265 /* Return the refused pages to the ballooned list. */ in vmballoon_deflate()
1270 /* If we failed to unlock all the pages, move to next size. */ in vmballoon_deflate()
1389 * vmballoon_pop - Quickly release all pages allocate for the balloon.
1395 * pages being released.
1418 /* free all pages, skipping monitor unlock */ in vmballoon_reset()
1508 * Returns: number of pages that were freed during deflation.
1545 * vmballoon_shrinker_count() - return the number of ballooned pages.
1549 * Returns: number of 4k pages that are allocated for the balloon and can
1918 * additional spurious resets from guest touching deallocated pages. in vmballoon_exit()