Lines Matching refs:nr_pages
403 static enum bp_state increase_reservation(unsigned long nr_pages) in increase_reservation() argument
409 if (nr_pages > ARRAY_SIZE(frame_list)) in increase_reservation()
410 nr_pages = ARRAY_SIZE(frame_list); in increase_reservation()
413 for (i = 0; i < nr_pages; i++) { in increase_reservation()
415 nr_pages = i; in increase_reservation()
423 rc = xenmem_reservation_increase(nr_pages, frame_list); in increase_reservation()
442 static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) in decrease_reservation() argument
450 if (nr_pages > ARRAY_SIZE(frame_list)) in decrease_reservation()
451 nr_pages = ARRAY_SIZE(frame_list); in decrease_reservation()
453 for (i = 0; i < nr_pages; i++) { in decrease_reservation()
456 nr_pages = i; in decrease_reservation()
491 ret = xenmem_reservation_decrease(nr_pages, frame_list); in decrease_reservation()
492 BUG_ON(ret != nr_pages); in decrease_reservation()
494 balloon_stats.current_pages -= nr_pages; in decrease_reservation()
585 static int add_ballooned_pages(unsigned int nr_pages) in add_ballooned_pages() argument
602 if (si_mem_available() < nr_pages) in add_ballooned_pages()
605 st = decrease_reservation(nr_pages, GFP_USER); in add_ballooned_pages()
618 int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages) in xen_alloc_unpopulated_pages() argument
626 balloon_stats.target_unpopulated += nr_pages; in xen_alloc_unpopulated_pages()
628 while (pgno < nr_pages) { in xen_alloc_unpopulated_pages()
646 ret = add_ballooned_pages(nr_pages - pgno); in xen_alloc_unpopulated_pages()
661 balloon_stats.target_unpopulated -= nr_pages - pgno; in xen_alloc_unpopulated_pages()
671 void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages) in xen_free_unpopulated_pages() argument
677 for (i = 0; i < nr_pages; i++) { in xen_free_unpopulated_pages()
682 balloon_stats.target_unpopulated -= nr_pages; in xen_free_unpopulated_pages()
728 ? min(xen_start_info->nr_pages - xen_released_pages, max_pfn) in balloon_init()