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.
362 * @huge_pages_lock: lock for the list of inflated 2MB pages.
397 /* allocation statistics for huge and small pages */
528 * 2MB pages are only supported with batching. If batching is for some in vmballoon_send_start()
529 * reason disabled, do not use 2MB pages, since otherwise the legacy in vmballoon_send_start()
530 * mechanism is used with 2MB pages, causing a failure. in vmballoon_send_start()
644 * vmballoon_alloc_page_list - allocates a list of pages.
648 * @req_n_pages: the number of requested pages.
650 * Tries to allocate @req_n_pages. Add them to the list of balloon pages in
651 * @ctl.pages and updates @ctl.n_pages to reflect the number of pages.
664 * First check if we happen to have pages that were allocated in vmballoon_alloc_page_list()
666 * by the hypervisor, and then split into 4KB pages. in vmballoon_alloc_page_list()
685 list_add(&page->lru, &ctl->pages); in vmballoon_alloc_page_list()
762 * vmballoon_lock_op - notifies the host about inflated/deflated pages.
764 * @num_pages: number of inflated/deflated pages.
770 * stop using them since the VM does). Host may reject some pages, we need to
771 * check the return value and maybe submit a different page. The pages that are
831 * vmballoon_lock - lock or unlock a batch of pages.
836 * Notifies the host of about ballooned pages (after inflation or deflation,
839 * next size of pages.
842 * pages list. Instead we queue it for later processing. We do that for several
845 * caller will check if there are too many refused pages and release them.
863 list_for_each_entry(page, &ctl->pages, lru) in vmballoon_lock()
870 * Iterate over the pages in the provided list. Since we are changing in vmballoon_lock()
892 * Error happened. Move the pages to the refused list and update in vmballoon_lock()
893 * the pages number. in vmballoon_lock()
908 * @page_list: list of pages to release.
909 * @n_pages: pointer to the number of pages.
910 * @page_size: whether the pages in the list are 2MB (or else 4KB).
912 * Releases the list of pages and zeros the number of pages.
931 * Release pages that were allocated while attempting to inflate the
980 * vmballoon_enqueue_page_list() - Enqueues list of pages after inflation.
983 * @pages: list of pages to enqueue.
984 * @n_pages: pointer to number of pages in list. The value is zeroed.
985 * @page_size: whether the pages are 2MB or 4KB pages.
987 * Enqueues the provides list of pages in the ballooned page list, clears the
988 * list and zeroes the number of pages that was provided.
991 struct list_head *pages, in vmballoon_enqueue_page_list() argument
998 balloon_page_list_enqueue(&b->b_dev_info, pages); in vmballoon_enqueue_page_list()
1001 * Keep the huge pages in a local list which is not available in vmballoon_enqueue_page_list()
1006 list_for_each_entry(page, pages, lru) { in vmballoon_enqueue_page_list()
1010 list_splice_init(pages, &b->huge_pages); in vmballoon_enqueue_page_list()
1023 * @pages: list of pages to enqueue.
1024 * @n_pages: pointer to number of pages in list. The value is zeroed.
1025 * @page_size: whether the pages are 2MB or 4KB pages.
1026 * @n_req_pages: the number of requested pages.
1028 * Dequeues the number of requested pages from the balloon for deflation. The
1029 * number of dequeued pages may be lower, if not enough pages in the requested
1033 struct list_head *pages, in vmballoon_dequeue_page_list() argument
1041 /* In the case of 4k pages, use the compaction infrastructure */ in vmballoon_dequeue_page_list()
1043 *n_pages = balloon_page_list_dequeue(&b->b_dev_info, pages, in vmballoon_dequeue_page_list()
1048 /* 2MB pages */ in vmballoon_dequeue_page_list()
1053 list_move(&page->lru, pages); in vmballoon_dequeue_page_list()
1065 * vmballoon_split_refused_pages() - Split the 2MB refused pages to 4k.
1067 * If inflation of 2MB pages was denied by the hypervisor, it is likely to be
1068 * due to one or few 4KB pages. These 2MB pages may keep being allocated and
1070 * pages into 4KB pages and adds them into @prealloc_pages list.
1099 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_inflate()
1110 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_inflate()
1123 /* Actually lock the pages by telling the hypervisor */ in vmballoon_inflate()
1136 vmballoon_enqueue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_inflate()
1140 * If allocation failed or the number of refused pages exceeds in vmballoon_inflate()
1149 * Split the refused pages to 4k. This will also empty in vmballoon_inflate()
1150 * the refused pages list. in vmballoon_inflate()
1160 * Release pages that were allocated while attempting to inflate the in vmballoon_inflate()
1188 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_deflate()
1194 /* free pages to reach target */ in vmballoon_deflate()
1203 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_deflate()
1228 /* First take the pages from the balloon pages. */ in vmballoon_deflate()
1229 vmballoon_dequeue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1233 * Before pages are moving to the refused list, count their in vmballoon_deflate()
1239 * Unlock the pages by communicating with the hypervisor if the in vmballoon_deflate()
1241 * return code. Instead we check if all the pages we manage to in vmballoon_deflate()
1242 * unlock all the pages. If we failed, we will move to the next in vmballoon_deflate()
1251 * place now, as once the pages are released, the number of in vmballoon_deflate()
1252 * pages is zeroed. in vmballoon_deflate()
1264 /* free the ballooned pages */ in vmballoon_deflate()
1265 vmballoon_release_page_list(&ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1268 /* Return the refused pages to the ballooned list. */ in vmballoon_deflate()
1273 /* If we failed to unlock all the pages, move to next size. */ in vmballoon_deflate()
1392 * vmballoon_pop - Quickly release all pages allocate for the balloon.
1398 * pages being released.
1421 /* free all pages, skipping monitor unlock */ in vmballoon_reset()
1511 * Returns: number of pages that were freed during deflation.
1548 * vmballoon_shrinker_count() - return the number of ballooned pages.
1552 * Returns: number of 4k pages that are allocated for the balloon and can
1868 * additional spurious resets from guest touching deallocated pages. in vmballoon_exit()