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
53 /* Maximum number of refused pages we accumulate during inflation cycle */
149 * ballooned pages (up to 512).
151 * pages that are about to be deflated from the
154 * for 2MB pages.
157 * pages.
242 struct list_head pages; member
317 * @batch_max_pages: maximum pages that can be locked/unlocked.
319 * Indicates the number of pages that the hypervisor can lock or unlock
357 * @huge_pages - list of the inflated 2MB pages.
403 /* allocation statistics for huge and small pages */
534 * 2MB pages are only supported with batching. If batching is for some in vmballoon_send_start()
535 * reason disabled, do not use 2MB pages, since otherwise the legacy in vmballoon_send_start()
536 * mechanism is used with 2MB pages, causing a failure. in vmballoon_send_start()
650 * vmballoon_alloc_page_list - allocates a list of pages.
654 * @req_n_pages: the number of requested pages.
656 * Tries to allocate @req_n_pages. Add them to the list of balloon pages in
657 * @ctl.pages and updates @ctl.n_pages to reflect the number of pages.
670 * First check if we happen to have pages that were allocated in vmballoon_alloc_page_list()
672 * by the hypervisor, and then split into 4KB pages. in vmballoon_alloc_page_list()
691 list_add(&page->lru, &ctl->pages); in vmballoon_alloc_page_list()
768 * vmballoon_lock_op - notifies the host about inflated/deflated pages.
770 * @num_pages: number of inflated/deflated pages.
776 * stop using them since the VM does). Host may reject some pages, we need to
777 * check the return value and maybe submit a different page. The pages that are
837 * vmballoon_lock - lock or unlock a batch of pages.
842 * Notifies the host of about ballooned pages (after inflation or deflation,
845 * next size of pages.
848 * pages list. Instead we queue it for later processing. We do that for several
851 * caller will check if there are too many refused pages and release them.
869 list_for_each_entry(page, &ctl->pages, lru) in vmballoon_lock()
876 * Iterate over the pages in the provided list. Since we are changing in vmballoon_lock()
898 * Error happened. Move the pages to the refused list and update in vmballoon_lock()
899 * the pages number. in vmballoon_lock()
914 * @page_list: list of pages to release.
915 * @n_pages: pointer to the number of pages.
916 * @page_size: whether the pages in the list are 2MB (or else 4KB).
918 * Releases the list of pages and zeros the number of pages.
937 * Release pages that were allocated while attempting to inflate the
986 * vmballoon_enqueue_page_list() - Enqueues list of pages after inflation.
989 * @pages: list of pages to enqueue.
990 * @n_pages: pointer to number of pages in list. The value is zeroed.
991 * @page_size: whether the pages are 2MB or 4KB pages.
993 * Enqueues the provides list of pages in the ballooned page list, clears the
994 * list and zeroes the number of pages that was provided.
997 struct list_head *pages, in vmballoon_enqueue_page_list() argument
1005 balloon_page_list_enqueue(&b->b_dev_info, pages); in vmballoon_enqueue_page_list()
1008 * Keep the huge pages in a local list which is not available in vmballoon_enqueue_page_list()
1013 list_for_each_entry(page, pages, lru) { in vmballoon_enqueue_page_list()
1017 list_splice_init(pages, &b->huge_pages); in vmballoon_enqueue_page_list()
1030 * @pages: list of pages to enqueue.
1031 * @n_pages: pointer to number of pages in list. The value is zeroed.
1032 * @page_size: whether the pages are 2MB or 4KB pages.
1033 * @n_req_pages: the number of requested pages.
1035 * Dequeues the number of requested pages from the balloon for deflation. The
1036 * number of dequeued pages may be lower, if not enough pages in the requested
1040 struct list_head *pages, in vmballoon_dequeue_page_list() argument
1049 /* In the case of 4k pages, use the compaction infrastructure */ in vmballoon_dequeue_page_list()
1051 *n_pages = balloon_page_list_dequeue(&b->b_dev_info, pages, in vmballoon_dequeue_page_list()
1056 /* 2MB pages */ in vmballoon_dequeue_page_list()
1061 list_move(&page->lru, pages); in vmballoon_dequeue_page_list()
1073 * vmballoon_split_refused_pages() - Split the 2MB refused pages to 4k.
1075 * If inflation of 2MB pages was denied by the hypervisor, it is likely to be
1076 * due to one or few 4KB pages. These 2MB pages may keep being allocated and
1078 * pages into 4KB pages and adds them into @prealloc_pages list.
1107 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_inflate()
1118 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_inflate()
1131 /* Actually lock the pages by telling the hypervisor */ in vmballoon_inflate()
1144 vmballoon_enqueue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_inflate()
1148 * If allocation failed or the number of refused pages exceeds in vmballoon_inflate()
1157 * Split the refused pages to 4k. This will also empty in vmballoon_inflate()
1158 * the refused pages list. in vmballoon_inflate()
1168 * Release pages that were allocated while attempting to inflate the in vmballoon_inflate()
1196 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_deflate()
1202 /* free pages to reach target */ in vmballoon_deflate()
1211 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_deflate()
1236 /* First take the pages from the balloon pages. */ in vmballoon_deflate()
1237 vmballoon_dequeue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1241 * Before pages are moving to the refused list, count their in vmballoon_deflate()
1247 * Unlock the pages by communicating with the hypervisor if the in vmballoon_deflate()
1249 * return code. Instead we check if all the pages we manage to in vmballoon_deflate()
1250 * unlock all the pages. If we failed, we will move to the next in vmballoon_deflate()
1259 * place now, as once the pages are released, the number of in vmballoon_deflate()
1260 * pages is zeroed. in vmballoon_deflate()
1272 /* free the ballooned pages */ in vmballoon_deflate()
1273 vmballoon_release_page_list(&ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1276 /* Return the refused pages to the ballooned list. */ in vmballoon_deflate()
1281 /* If we failed to unlock all the pages, move to next size. */ in vmballoon_deflate()
1400 * vmballoon_pop - Quickly release all pages allocate for the balloon.
1406 * pages being released.
1429 /* free all pages, skipping monitor unlock */ in vmballoon_reset()
1519 * Returns: number of pages that were freed during deflation.
1556 * vmballoon_shrinker_count() - return the number of ballooned pages.
1560 * Returns: number of 4k pages that are allocated for the balloon and can
1984 * additional spurious resets from guest touching deallocated pages. in vmballoon_exit()