Lines Matching +full:page +full:- +full:size

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2000-2018, VMware, Inc. All Rights Reserved.
46 …"Enable non-cooperative out-of-memory protection. Disabled by default as it may degrade performanc…
54 /* Magic number for the balloon mount-point */
80 #define VMW_BALLOON_2M_ORDER (PMD_SHIFT - PAGE_SHIFT)
83 * 64-bit targets are only supported in 64-bit
118 * enum vmballoon_cmd_type - backdoor commands.
140 * @VMW_BALLOON_CMD_GET_TARGET: Gets the balloon target size.
141 * @VMW_BALLOON_CMD_LOCK: Informs the hypervisor about a ballooned page.
142 * @VMW_BALLOON_CMD_UNLOCK: Informs the hypervisor about a page that is about
158 * size changes.
209 [VMW_BALLOON_CMD_BATCHED_2M_LOCK] = "2m-lock",
210 [VMW_BALLOON_CMD_BATCHED_2M_UNLOCK] = "2m-unlock",
250 * struct vmballoon_batch_entry - a batch entry for lock or unlock.
254 * @pfn: the physical frame number of the page to be locked or unlocked.
258 u64 reserved : PAGE_SHIFT - 5;
264 * @max_page_size: maximum supported page size for ballooning.
271 * @size: balloon actual size in basic page size (frames).
273 * While we currently do not support size which is bigger than 32-bit,
274 * in preparation for future support, use 64-bits.
276 atomic64_t size; member
279 * @target: balloon target size in basic page size (frames).
307 * @batch_page: pointer to communication batch page.
309 * When batching is used, batch_page points to a page, which holds up to
319 * disabled, only a single page can be locked/unlock on each operation.
326 * @page: page to be locked/unlocked by the hypervisor
328 * @page is only used when batching is disabled and a single page is
333 struct page *page; member
355 * @huge_pages - list of the inflated 2MB pages.
376 * Lock ordering: @conf_sem -> @comm_lock .
381 * @shrinker: shrinker interface that is used to avoid over-inflation.
410 atomic64_inc(&b->stats->ops[op][type]); in vmballoon_stats_op_inc()
417 atomic64_inc(&b->stats->general_stat[stat]); in vmballoon_stats_gen_inc()
425 atomic64_add(val, &b->stats->general_stat[stat]); in vmballoon_stats_gen_add()
430 enum vmballoon_page_size_type size) in vmballoon_stats_page_inc() argument
433 atomic64_inc(&b->stats->page_stat[stat][size]); in vmballoon_stats_page_inc()
438 enum vmballoon_page_size_type size, in vmballoon_stats_page_add() argument
442 atomic64_add(val, &b->stats->page_stat[stat][size]); in vmballoon_stats_page_add()
474 WRITE_ONCE(b->target, local_result); in __vmballoon_cmd()
486 b->reset_required = true; in __vmballoon_cmd()
513 b->capabilities = capabilities; in vmballoon_send_start()
516 b->capabilities = VMW_BALLOON_BASIC_CMDS; in vmballoon_send_start()
519 return -EIO; in vmballoon_send_start()
527 b->max_page_size = VMW_BALLOON_4K_PAGE; in vmballoon_send_start()
528 if ((b->capabilities & VMW_BALLOON_BATCHED_2M_CMDS) && in vmballoon_send_start()
529 (b->capabilities & VMW_BALLOON_BATCHED_CMDS)) in vmballoon_send_start()
530 b->max_page_size = VMW_BALLOON_2M_PAGE; in vmballoon_send_start()
537 * vmballoon_send_guest_id - communicate guest type to the host.
555 return status == VMW_BALLOON_SUCCESS ? 0 : -EIO; in vmballoon_send_guest_id()
559 * vmballoon_page_order() - return the order of the page
560 * @page_size: the size of the page.
571 * vmballoon_page_in_frames() - returns the number of frames in a page.
572 * @page_size: the size of the page.
583 * vmballoon_mark_page_offline() - mark a page as offline
584 * @page: pointer for the page.
585 * @page_size: the size of the page.
588 vmballoon_mark_page_offline(struct page *page, in vmballoon_mark_page_offline() argument
594 __SetPageOffline(page + i); in vmballoon_mark_page_offline()
598 * vmballoon_mark_page_online() - mark a page as online
599 * @page: pointer for the page.
600 * @page_size: the size of the page.
603 vmballoon_mark_page_online(struct page *page, in vmballoon_mark_page_online() argument
609 __ClearPageOffline(page + i); in vmballoon_mark_page_online()
613 * vmballoon_send_get_target() - Retrieve desired balloon size from the host.
617 * Return: zero on success, EINVAL if limit does not fit in 32-bit, as required
618 * by the host-guest protocol and EIO if an error occurred in communicating with
628 /* Ensure limit fits in 32-bits if 64-bit targets are not supported */ in vmballoon_send_get_target()
629 if (!(b->capabilities & VMW_BALLOON_64_BIT_TARGET) && in vmballoon_send_get_target()
631 return -EINVAL; in vmballoon_send_get_target()
635 return status == VMW_BALLOON_SUCCESS ? 0 : -EIO; in vmballoon_send_get_target()
639 * vmballoon_alloc_page_list - allocates a list of pages.
654 struct page *page; in vmballoon_alloc_page_list() local
660 * before. This happens when 2MB page rejected during inflation in vmballoon_alloc_page_list()
663 if (!list_empty(&ctl->prealloc_pages)) { in vmballoon_alloc_page_list()
664 page = list_first_entry(&ctl->prealloc_pages, in vmballoon_alloc_page_list()
665 struct page, lru); in vmballoon_alloc_page_list()
666 list_del(&page->lru); in vmballoon_alloc_page_list()
668 if (ctl->page_size == VMW_BALLOON_2M_PAGE) in vmballoon_alloc_page_list()
669 page = alloc_pages(__GFP_HIGHMEM|__GFP_NOWARN| in vmballoon_alloc_page_list()
672 page = balloon_page_alloc(); in vmballoon_alloc_page_list()
675 ctl->page_size); in vmballoon_alloc_page_list()
678 if (page) { in vmballoon_alloc_page_list()
679 /* Success. Add the page to the list and continue. */ in vmballoon_alloc_page_list()
680 list_add(&page->lru, &ctl->pages); in vmballoon_alloc_page_list()
686 ctl->page_size); in vmballoon_alloc_page_list()
690 ctl->n_pages = i; in vmballoon_alloc_page_list()
692 return req_n_pages == ctl->n_pages ? 0 : -ENOMEM; in vmballoon_alloc_page_list()
696 * vmballoon_handle_one_result - Handle lock/unlock result for a single page.
699 * @page: pointer for the page whose result should be handled.
700 * @page_size: size of the page.
703 static int vmballoon_handle_one_result(struct vmballoon *b, struct page *page, in vmballoon_handle_one_result() argument
707 /* On success do nothing. The page is already on the balloon list. */ in vmballoon_handle_one_result()
712 page_to_pfn(page), status, in vmballoon_handle_one_result()
719 return -EIO; in vmballoon_handle_one_result()
723 * vmballoon_status_page - returns the status of (un)lock operation
726 * @idx: index for the page for which the operation is performed.
727 * @p: pointer to where the page struct is returned.
730 * an individual page. Provides the page that the operation was performed on on
731 * the @page argument.
733 * Returns: The status of a lock or unlock operation for an individual page.
736 struct page **p) in vmballoon_status_page()
740 *p = pfn_to_page(b->batch_page[idx].pfn); in vmballoon_status_page()
741 return b->batch_page[idx].status; in vmballoon_status_page()
744 /* non-batching mode */ in vmballoon_status_page()
745 *p = b->page; in vmballoon_status_page()
750 * page status. So for non-batching mode, the indication is always of in vmballoon_status_page()
757 * vmballoon_lock_op - notifies the host about inflated/deflated pages.
760 * @page_size: size of the page.
763 * Notify the host about page(s) that were ballooned (or removed from the
766 * check the return value and maybe submit a different page. The pages that are
767 * inflated/deflated are pointed by @b->page.
778 lockdep_assert_held(&b->comm_lock); in vmballoon_lock_op()
790 pfn = PHYS_PFN(virt_to_phys(b->batch_page)); in vmballoon_lock_op()
794 pfn = page_to_pfn(b->page); in vmballoon_lock_op()
796 /* In non-batching mode, PFNs must fit in 32-bit */ in vmballoon_lock_op()
805 * vmballoon_add_page - adds a page towards lock/unlock operation.
808 * @idx: index of the page to be ballooned in this batch.
809 * @p: pointer to the page that is about to be ballooned.
811 * Adds the page to be ballooned. Must be called while holding @comm_lock.
814 struct page *p) in vmballoon_add_page()
816 lockdep_assert_held(&b->comm_lock); in vmballoon_add_page()
819 b->batch_page[idx] = (struct vmballoon_batch_entry) in vmballoon_add_page()
822 b->page = p; in vmballoon_add_page()
826 * vmballoon_lock - lock or unlock a batch of pages.
832 * according to @ctl). If the host rejects the page put it on the
833 * @ctl refuse list. These refused page are then released when moving to the
834 * next size of pages.
836 * Note that we neither free any @page here nor put them back on the ballooned
838 * reasons. First, we do not want to free the page under the lock. Second, it
847 struct page *page; in vmballoon_lock() local
850 num_pages = ctl->n_pages; in vmballoon_lock()
855 spin_lock(&b->comm_lock); in vmballoon_lock()
858 list_for_each_entry(page, &ctl->pages, lru) in vmballoon_lock()
859 vmballoon_add_page(b, i++, page); in vmballoon_lock()
861 batch_status = vmballoon_lock_op(b, ctl->n_pages, ctl->page_size, in vmballoon_lock()
862 ctl->op); in vmballoon_lock()
866 * @ctl->n_pages we are saving the original value in @num_pages and in vmballoon_lock()
872 status = vmballoon_status_page(b, i, &page); in vmballoon_lock()
882 if (!vmballoon_handle_one_result(b, page, ctl->page_size, in vmballoon_lock()
890 list_move(&page->lru, &ctl->refused_pages); in vmballoon_lock()
891 ctl->n_pages--; in vmballoon_lock()
892 ctl->n_refused_pages++; in vmballoon_lock()
895 spin_unlock(&b->comm_lock); in vmballoon_lock()
897 return batch_status == VMW_BALLOON_SUCCESS ? 0 : -EIO; in vmballoon_lock()
901 * vmballoon_release_page_list() - Releases a page list
913 struct page *page, *tmp; in vmballoon_release_page_list() local
915 list_for_each_entry_safe(page, tmp, page_list, lru) { in vmballoon_release_page_list()
916 list_del(&page->lru); in vmballoon_release_page_list()
917 __free_pages(page, vmballoon_page_order(page_size)); in vmballoon_release_page_list()
933 ctl->page_size); in vmballoon_release_refused_pages()
935 vmballoon_release_page_list(&ctl->refused_pages, &ctl->n_refused_pages, in vmballoon_release_refused_pages()
936 ctl->page_size); in vmballoon_release_refused_pages()
940 * vmballoon_change - retrieve the required balloon change
944 * Return: the required change for the balloon size. A positive number
949 int64_t size, target; in vmballoon_change() local
951 size = atomic64_read(&b->size); in vmballoon_change()
952 target = READ_ONCE(b->target); in vmballoon_change()
959 if (b->reset_required) in vmballoon_change()
963 if (target < size && target != 0 && in vmballoon_change()
964 size - target < vmballoon_page_in_frames(VMW_BALLOON_2M_PAGE)) in vmballoon_change()
967 /* If an out-of-memory recently occurred, inflation is disallowed. */ in vmballoon_change()
968 if (target > size && time_before(jiffies, READ_ONCE(b->shrink_timeout))) in vmballoon_change()
971 return target - size; in vmballoon_change()
975 * vmballoon_enqueue_page_list() - Enqueues list of pages after inflation.
982 * Enqueues the provides list of pages in the ballooned page list, clears the
991 struct page *page; in vmballoon_enqueue_page_list() local
994 balloon_page_list_enqueue(&b->b_dev_info, pages); in vmballoon_enqueue_page_list()
1000 spin_lock_irqsave(&b->b_dev_info.pages_lock, flags); in vmballoon_enqueue_page_list()
1002 list_for_each_entry(page, pages, lru) { in vmballoon_enqueue_page_list()
1003 vmballoon_mark_page_offline(page, VMW_BALLOON_2M_PAGE); in vmballoon_enqueue_page_list()
1006 list_splice_init(pages, &b->huge_pages); in vmballoon_enqueue_page_list()
1009 spin_unlock_irqrestore(&b->b_dev_info.pages_lock, flags); in vmballoon_enqueue_page_list()
1016 * vmballoon_dequeue_page_list() - Dequeues page lists for deflation.
1026 * size are available.
1034 struct page *page, *tmp; in vmballoon_dequeue_page_list() local
1040 *n_pages = balloon_page_list_dequeue(&b->b_dev_info, pages, in vmballoon_dequeue_page_list()
1046 spin_lock_irqsave(&b->b_dev_info.pages_lock, flags); in vmballoon_dequeue_page_list()
1047 list_for_each_entry_safe(page, tmp, &b->huge_pages, lru) { in vmballoon_dequeue_page_list()
1048 vmballoon_mark_page_online(page, VMW_BALLOON_2M_PAGE); in vmballoon_dequeue_page_list()
1050 list_move(&page->lru, pages); in vmballoon_dequeue_page_list()
1057 spin_unlock_irqrestore(&b->b_dev_info.pages_lock, flags); in vmballoon_dequeue_page_list()
1062 * vmballoon_split_refused_pages() - Split the 2MB refused pages to 4k.
1073 struct page *page, *tmp; in vmballoon_split_refused_pages() local
1076 order = vmballoon_page_order(ctl->page_size); in vmballoon_split_refused_pages()
1078 list_for_each_entry_safe(page, tmp, &ctl->refused_pages, lru) { in vmballoon_split_refused_pages()
1079 list_del(&page->lru); in vmballoon_split_refused_pages()
1080 split_page(page, order); in vmballoon_split_refused_pages()
1082 list_add(&page[i].lru, &ctl->prealloc_pages); in vmballoon_split_refused_pages()
1084 ctl->n_refused_pages = 0; in vmballoon_split_refused_pages()
1088 * vmballoon_inflate() - Inflate the balloon towards its target size.
1099 .page_size = b->max_page_size, in vmballoon_inflate()
1112 to_inflate_pages = min_t(unsigned long, b->batch_max_pages, in vmballoon_inflate()
1130 /* Update the balloon size */ in vmballoon_inflate()
1131 atomic64_add(ctl.n_pages * page_in_frames, &b->size); in vmballoon_inflate()
1138 * the maximum allowed, move to the next page size. in vmballoon_inflate()
1150 ctl.page_size--; in vmballoon_inflate()
1168 * vmballoon_deflate() - Decrease the size of the balloon.
1172 * calculated according to the target size.
1175 * Decrease the size of the balloon allowing guest to use more memory.
1177 * Return: The number of deflated frames (i.e., basic page size units)
1208 * performed according to the target and balloon size. in vmballoon_deflate()
1210 to_deflate_frames = n_frames ? n_frames - tried_frames : in vmballoon_deflate()
1211 -vmballoon_change(b); in vmballoon_deflate()
1218 * Calculate the number of frames based on current page size, in vmballoon_deflate()
1221 to_deflate_pages = min_t(unsigned long, b->batch_max_pages, in vmballoon_deflate()
1240 * page size, and would eventually try again later. in vmballoon_deflate()
1246 * Check if we deflated enough. We will move to the next page in vmballoon_deflate()
1247 * size if we did not manage to do so. This calculation takes in vmballoon_deflate()
1255 atomic64_sub(n_unlocked_frames, &b->size); in vmballoon_deflate()
1270 /* If we failed to unlock all the pages, move to next size. */ in vmballoon_deflate()
1272 if (ctl.page_size == b->max_page_size) in vmballoon_deflate()
1284 * vmballoon_deinit_batching - disables batching mode.
1288 * Disables batching, by deallocating the page for communication with the
1293 free_page((unsigned long)b->batch_page); in vmballoon_deinit_batching()
1294 b->batch_page = NULL; in vmballoon_deinit_batching()
1296 b->batch_max_pages = 1; in vmballoon_deinit_batching()
1300 * vmballoon_init_batching - enable batching mode.
1304 * Enables batching, by allocating a page for communication with the hypervisor
1307 * Return: zero on success or an appropriate error-code.
1311 struct page *page; in vmballoon_init_batching() local
1313 page = alloc_page(GFP_KERNEL | __GFP_ZERO); in vmballoon_init_batching()
1314 if (!page) in vmballoon_init_batching()
1315 return -ENOMEM; in vmballoon_init_batching()
1317 b->batch_page = page_address(page); in vmballoon_init_batching()
1318 b->batch_max_pages = PAGE_SIZE / sizeof(struct vmballoon_batch_entry); in vmballoon_init_batching()
1334 mod_delayed_work(system_freezable_wq, &b->dwork, 0); in vmballoon_doorbell()
1345 if (!vmci_handle_is_invalid(b->vmci_doorbell)) { in vmballoon_vmci_cleanup()
1346 vmci_doorbell_destroy(b->vmci_doorbell); in vmballoon_vmci_cleanup()
1347 b->vmci_doorbell = VMCI_INVALID_HANDLE; in vmballoon_vmci_cleanup()
1352 * vmballoon_vmci_init - Initialize vmci doorbell.
1356 * Return: zero on success or when wakeup command not supported. Error-code
1365 if ((b->capabilities & VMW_BALLOON_SIGNALLED_WAKEUP_CMD) == 0) in vmballoon_vmci_init()
1368 error = vmci_doorbell_create(&b->vmci_doorbell, VMCI_FLAG_DELAYED_CB, in vmballoon_vmci_init()
1376 b->vmci_doorbell.context, in vmballoon_vmci_init()
1377 b->vmci_doorbell.resource, NULL); in vmballoon_vmci_init()
1385 return -EIO; in vmballoon_vmci_init()
1389 * vmballoon_pop - Quickly release all pages allocate for the balloon.
1399 unsigned long size; in vmballoon_pop() local
1401 while ((size = atomic64_read(&b->size))) in vmballoon_pop()
1402 vmballoon_deflate(b, size, false); in vmballoon_pop()
1414 down_write(&b->conf_sem); in vmballoon_reset()
1424 if ((b->capabilities & VMW_BALLOON_BATCHED_CMDS) != 0) { in vmballoon_reset()
1435 } else if ((b->capabilities & VMW_BALLOON_BASIC_CMDS) != 0) { in vmballoon_reset()
1440 b->reset_required = false; in vmballoon_reset()
1450 up_write(&b->conf_sem); in vmballoon_reset()
1454 * vmballoon_work - periodic balloon worker for reset, inflation and deflation.
1458 * Resets the protocol if needed, gets the new size and adjusts balloon as
1467 if (b->reset_required) in vmballoon_work()
1470 down_read(&b->conf_sem); in vmballoon_work()
1483 pr_debug("%s - size: %llu, target %lu\n", __func__, in vmballoon_work()
1484 atomic64_read(&b->size), READ_ONCE(b->target)); in vmballoon_work()
1492 up_read(&b->conf_sem); in vmballoon_work()
1504 * vmballoon_shrinker_scan() - deflate the balloon due to memory pressure.
1506 * @sc: page reclaim information.
1516 pr_debug("%s - size: %llu", __func__, atomic64_read(&b->size)); in vmballoon_shrinker_scan()
1524 if (!down_read_trylock(&b->conf_sem)) in vmballoon_shrinker_scan()
1527 deflated_frames = vmballoon_deflate(b, sc->nr_to_scan, true); in vmballoon_shrinker_scan()
1537 WRITE_ONCE(b->shrink_timeout, jiffies + HZ * VMBALLOON_SHRINK_DELAY); in vmballoon_shrinker_scan()
1539 up_read(&b->conf_sem); in vmballoon_shrinker_scan()
1545 * vmballoon_shrinker_count() - return the number of ballooned pages.
1547 * @sc: page reclaim information.
1557 return atomic64_read(&b->size); in vmballoon_shrinker_count()
1562 shrinker_free(b->shrinker); in vmballoon_unregister_shrinker()
1563 b->shrinker = NULL; in vmballoon_unregister_shrinker()
1572 b->shrinker = shrinker_alloc(0, "vmw-balloon"); in vmballoon_register_shrinker()
1573 if (!b->shrinker) in vmballoon_register_shrinker()
1574 return -ENOMEM; in vmballoon_register_shrinker()
1576 b->shrinker->scan_objects = vmballoon_shrinker_scan; in vmballoon_register_shrinker()
1577 b->shrinker->count_objects = vmballoon_shrinker_count; in vmballoon_register_shrinker()
1578 b->shrinker->private_data = b; in vmballoon_register_shrinker()
1580 shrinker_register(b->shrinker); in vmballoon_register_shrinker()
1610 down_write(&b->conf_sem); in vmballoon_enable_stats()
1613 if (b->stats) in vmballoon_enable_stats()
1616 b->stats = kzalloc(sizeof(*b->stats), GFP_KERNEL); in vmballoon_enable_stats()
1618 if (!b->stats) { in vmballoon_enable_stats()
1620 r = -ENOMEM; in vmballoon_enable_stats()
1625 up_write(&b->conf_sem); in vmballoon_enable_stats()
1630 * vmballoon_debug_show - shows statistics of balloon operations.
1635 * To avoid the overhead - mainly that of memory - of collecting the statistics,
1642 struct vmballoon *b = f->private; in vmballoon_debug_show()
1646 if (!b->stats) { in vmballoon_debug_show()
1654 seq_printf(f, "%-22s: %#16x\n", "balloon capabilities", in vmballoon_debug_show()
1656 seq_printf(f, "%-22s: %#16lx\n", "used capabilities", b->capabilities); in vmballoon_debug_show()
1657 seq_printf(f, "%-22s: %16s\n", "is resetting", in vmballoon_debug_show()
1658 b->reset_required ? "y" : "n"); in vmballoon_debug_show()
1660 /* format size info */ in vmballoon_debug_show()
1661 seq_printf(f, "%-22s: %16lu\n", "target", READ_ONCE(b->target)); in vmballoon_debug_show()
1662 seq_printf(f, "%-22s: %16llu\n", "current", atomic64_read(&b->size)); in vmballoon_debug_show()
1668 seq_printf(f, "%-22s: %16llu (%llu failed)\n", in vmballoon_debug_show()
1670 atomic64_read(&b->stats->ops[i][VMW_BALLOON_OP_STAT]), in vmballoon_debug_show()
1671 atomic64_read(&b->stats->ops[i][VMW_BALLOON_OP_FAIL_STAT])); in vmballoon_debug_show()
1675 seq_printf(f, "%-22s: %16llu\n", in vmballoon_debug_show()
1677 atomic64_read(&b->stats->general_stat[i])); in vmballoon_debug_show()
1681 seq_printf(f, "%-18s(%s): %16llu\n", in vmballoon_debug_show()
1684 atomic64_read(&b->stats->page_stat[i][j])); in vmballoon_debug_show()
1702 kfree(b->stats); in vmballoon_debugfs_exit()
1703 b->stats = NULL; in vmballoon_debugfs_exit()
1721 * vmballoon_migratepage() - migrates a balloon page.
1723 * @newpage: the page to which @page should be migrated.
1724 * @page: a ballooned page that should be migrated.
1727 * This function is really open-coded, but that is according to the interface
1730 * Return: zero on success, -EAGAIN when migration cannot be performed
1731 * momentarily, and -EBUSY if migration failed and should be retried
1732 * with that specific page.
1735 struct page *newpage, struct page *page, in vmballoon_migratepage() argument
1748 if (!down_read_trylock(&b->conf_sem)) in vmballoon_migratepage()
1749 return -EAGAIN; in vmballoon_migratepage()
1751 spin_lock(&b->comm_lock); in vmballoon_migratepage()
1754 * hypervisor may tell us that it has enough memory and the new page is in vmballoon_migratepage()
1755 * not needed. Since the old page is isolated, we cannot use the list in vmballoon_migratepage()
1759 vmballoon_add_page(b, 0, page); in vmballoon_migratepage()
1764 status = vmballoon_status_page(b, 0, &page); in vmballoon_migratepage()
1771 spin_unlock(&b->comm_lock); in vmballoon_migratepage()
1772 ret = -EBUSY; in vmballoon_migratepage()
1777 * The page is isolated, so it is safe to delete it without holding in vmballoon_migratepage()
1781 balloon_page_delete(page); in vmballoon_migratepage()
1783 put_page(page); in vmballoon_migratepage()
1793 spin_unlock(&b->comm_lock); in vmballoon_migratepage()
1797 * A failure happened. While we can deflate the page we just in vmballoon_migratepage()
1799 * we will decrease the size of the balloon to reflect the in vmballoon_migratepage()
1802 atomic64_dec(&b->size); in vmballoon_migratepage()
1803 ret = -EBUSY; in vmballoon_migratepage()
1806 * Success. Take a reference for the page, and we will add it to in vmballoon_migratepage()
1814 spin_lock_irqsave(&b->b_dev_info.pages_lock, flags); in vmballoon_migratepage()
1822 balloon_page_insert(&b->b_dev_info, newpage); in vmballoon_migratepage()
1830 b->b_dev_info.isolated_pages--; in vmballoon_migratepage()
1831 spin_unlock_irqrestore(&b->b_dev_info.pages_lock, flags); in vmballoon_migratepage()
1834 up_read(&b->conf_sem); in vmballoon_migratepage()
1839 * vmballoon_compaction_init() - initialized compaction for the balloon.
1851 b->b_dev_info.migratepage = vmballoon_migratepage; in vmballoon_compaction_init()
1869 return -ENODEV; in vmballoon_init()
1889 balloon.page = NULL; in vmballoon_init()