• Home
  • Raw
  • Download

Lines Matching refs:ctl

667 				     struct vmballoon_ctl *ctl,  in vmballoon_alloc_page_list()  argument
679 if (!list_empty(&ctl->prealloc_pages)) { in vmballoon_alloc_page_list()
680 page = list_first_entry(&ctl->prealloc_pages, in vmballoon_alloc_page_list()
684 if (ctl->page_size == VMW_BALLOON_2M_PAGE) in vmballoon_alloc_page_list()
691 ctl->page_size); in vmballoon_alloc_page_list()
696 list_add(&page->lru, &ctl->pages); in vmballoon_alloc_page_list()
702 ctl->page_size); in vmballoon_alloc_page_list()
706 ctl->n_pages = i; in vmballoon_alloc_page_list()
708 return req_n_pages == ctl->n_pages ? 0 : -ENOMEM; in vmballoon_alloc_page_list()
860 static int vmballoon_lock(struct vmballoon *b, struct vmballoon_ctl *ctl) in vmballoon_lock() argument
866 num_pages = ctl->n_pages; in vmballoon_lock()
874 list_for_each_entry(page, &ctl->pages, lru) in vmballoon_lock()
877 batch_status = vmballoon_lock_op(b, ctl->n_pages, ctl->page_size, in vmballoon_lock()
878 ctl->op); in vmballoon_lock()
898 if (!vmballoon_handle_one_result(b, page, ctl->page_size, in vmballoon_lock()
906 list_move(&page->lru, &ctl->refused_pages); in vmballoon_lock()
907 ctl->n_pages--; in vmballoon_lock()
908 ctl->n_refused_pages++; in vmballoon_lock()
946 struct vmballoon_ctl *ctl) in vmballoon_release_refused_pages() argument
949 ctl->page_size); in vmballoon_release_refused_pages()
951 vmballoon_release_page_list(&ctl->refused_pages, &ctl->n_refused_pages, in vmballoon_release_refused_pages()
952 ctl->page_size); in vmballoon_release_refused_pages()
1087 static void vmballoon_split_refused_pages(struct vmballoon_ctl *ctl) in vmballoon_split_refused_pages() argument
1092 order = vmballoon_page_order(ctl->page_size); in vmballoon_split_refused_pages()
1094 list_for_each_entry_safe(page, tmp, &ctl->refused_pages, lru) { in vmballoon_split_refused_pages()
1098 list_add(&page[i].lru, &ctl->prealloc_pages); in vmballoon_split_refused_pages()
1100 ctl->n_refused_pages = 0; in vmballoon_split_refused_pages()
1111 struct vmballoon_ctl ctl = { in vmballoon_inflate() local
1112 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_inflate()
1113 .refused_pages = LIST_HEAD_INIT(ctl.refused_pages), in vmballoon_inflate()
1114 .prealloc_pages = LIST_HEAD_INIT(ctl.prealloc_pages), in vmballoon_inflate()
1123 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_inflate()
1124 VM_BUG_ON(ctl.n_pages != 0); in vmballoon_inflate()
1126 page_in_frames = vmballoon_page_in_frames(ctl.page_size); in vmballoon_inflate()
1133 alloc_error = vmballoon_alloc_page_list(b, &ctl, in vmballoon_inflate()
1137 lock_error = vmballoon_lock(b, &ctl); in vmballoon_inflate()
1147 atomic64_add(ctl.n_pages * page_in_frames, &b->size); in vmballoon_inflate()
1149 vmballoon_enqueue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_inflate()
1150 ctl.page_size); in vmballoon_inflate()
1157 ctl.n_refused_pages >= VMW_BALLOON_MAX_REFUSED) { in vmballoon_inflate()
1158 if (ctl.page_size == VMW_BALLOON_4K_PAGE) in vmballoon_inflate()
1165 vmballoon_split_refused_pages(&ctl); in vmballoon_inflate()
1166 ctl.page_size--; in vmballoon_inflate()
1177 if (ctl.n_refused_pages != 0) in vmballoon_inflate()
1178 vmballoon_release_refused_pages(b, &ctl); in vmballoon_inflate()
1180 vmballoon_release_page_list(&ctl.prealloc_pages, NULL, ctl.page_size); in vmballoon_inflate()
1200 struct vmballoon_ctl ctl = { in vmballoon_deflate() local
1201 .pages = LIST_HEAD_INIT(ctl.pages), in vmballoon_deflate()
1202 .refused_pages = LIST_HEAD_INIT(ctl.refused_pages), in vmballoon_deflate()
1214 page_in_frames = vmballoon_page_in_frames(ctl.page_size); in vmballoon_deflate()
1216 VM_BUG_ON(!list_empty(&ctl.pages)); in vmballoon_deflate()
1217 VM_BUG_ON(ctl.n_pages); in vmballoon_deflate()
1218 VM_BUG_ON(!list_empty(&ctl.refused_pages)); in vmballoon_deflate()
1219 VM_BUG_ON(ctl.n_refused_pages); in vmballoon_deflate()
1242 vmballoon_dequeue_page_list(b, &ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1243 ctl.page_size, to_deflate_pages); in vmballoon_deflate()
1249 tried_frames += ctl.n_pages * page_in_frames; in vmballoon_deflate()
1259 vmballoon_lock(b, &ctl); in vmballoon_deflate()
1267 deflated_all = (ctl.n_pages == to_deflate_pages); in vmballoon_deflate()
1270 n_unlocked_frames = ctl.n_pages * page_in_frames; in vmballoon_deflate()
1275 ctl.page_size, ctl.n_pages); in vmballoon_deflate()
1278 vmballoon_release_page_list(&ctl.pages, &ctl.n_pages, in vmballoon_deflate()
1279 ctl.page_size); in vmballoon_deflate()
1282 vmballoon_enqueue_page_list(b, &ctl.refused_pages, in vmballoon_deflate()
1283 &ctl.n_refused_pages, in vmballoon_deflate()
1284 ctl.page_size); in vmballoon_deflate()
1288 if (ctl.page_size == b->max_page_size) in vmballoon_deflate()
1290 ctl.page_size++; in vmballoon_deflate()