linux/drivers/misc/vmw_balloon.c
/*
 * Quickly release all pages allocated for the balloon. This function is
 * called when host decides to "reset" balloon for one reason or another.
 * Unlike normal "deflate" we do not (shall not) notify host of the pages
 * being released.
 */
Quickly release all pages allocated for the balloon. This function is
called when host decides to "reset" balloon for one reason or another.
Unlike normal "deflate" we do not (shall not) notify host of the pages
being released.
Quickly release all pages allocated for the balloon . This function is called when host decides to " reset " balloon for one reason or another . Unlike normal " deflate " we do not ( shall not ) notify host of the pages being released .
static void vmballoon_pop(struct vmballoon *b)
{
	struct page *page, *next;
	unsigned is_2m_pages;
	for (is_2m_pages = 0; is_2m_pages < VMW_BALLOON_NUM_PAGE_SIZES;
			is_2m_pages++) {
		struct vmballoon_page_size *page_size =
				&b->page_sizes[is_2m_pages];
		u16 size_per_page = vmballoon_page_size(is_2m_pages);
		list_for_each_entry_safe(page, next, &page_size->pages, lru) {
			list_del(&page->lru);
			vmballoon_free_page(page, is_2m_pages);
			STATS_INC(b->stats.free[is_2m_pages]);
			b->size -= size_per_page;
			cond_resched();
		}
	}
	free_page((unsigned long)b->batch_page);
	b->batch_page = NULL;
}
static void vmballoon_pop ( struct vmballoon * b ) { struct page * page , * next ; unsigned is_2m_pages ; for ( is_2m_pages = 0 ; is_2m_pages < VMW_BALLOON_NUM_PAGE_SIZES ; is_2m_pages ++ ) { struct vmballoon_page_size * page_size = & b -> page_sizes [ is_2m_pages ] ; u16 size_per_page = vmballoon_page_size ( is_2m_pages ) ; list_for_each_entry_safe ( page , next , & page_size -> pages , lru ) { list_del ( & page -> lru ) ; vmballoon_free_page ( page , is_2m_pages ) ; STATS_INC ( b -> stats . free [ is_2m_pages ] ) ; b -> size -= size_per_page ; cond_resched ( ) ; } } free_page ( ( unsigned long ) b -> batch_page ) ; b -> batch_page = NULL ; }
Quickly release all pages allocated for the balloon.
Quickly release all pages allocated for the balloon .
/* Clearing the batch_page unconditionally has no adverse effect */