Lines Matching refs:chg
198 long chg = 0; in region_chg() local
224 chg = t - f; in region_chg()
231 chg = t - f; in region_chg()
244 chg += rg->to - t; in region_chg()
247 chg -= rg->to - rg->from; in region_chg()
254 return chg; in region_chg()
257 return chg; in region_chg()
264 long chg = 0; in region_truncate() local
276 chg = rg->to - end; in region_truncate()
285 chg += rg->to - rg->from; in region_truncate()
292 return chg; in region_truncate()
299 long chg = 0; in region_count() local
315 chg += seg_to - seg_from; in region_count()
319 return chg; in region_count()
483 static int vma_has_reserves(struct vm_area_struct *vma, long chg) in vma_has_reserves() argument
495 if (vma->vm_flags & VM_MAYSHARE && chg == 0) in vma_has_reserves()
555 long chg) in dequeue_huge_page_vma() argument
570 if (!vma_has_reserves(vma, chg) && in dequeue_huge_page_vma()
590 if (!vma_has_reserves(vma, chg)) in dequeue_huge_page_vma()
1362 long chg; in vma_needs_reservation() local
1369 chg = region_chg(resv, idx, idx + 1); in vma_needs_reservation()
1372 return chg; in vma_needs_reservation()
1374 return chg < 0 ? chg : 0; in vma_needs_reservation()
1396 long chg; in alloc_huge_page() local
1409 chg = vma_needs_reservation(h, vma, addr); in alloc_huge_page()
1410 if (chg < 0) in alloc_huge_page()
1412 if (chg || avoid_reserve) in alloc_huge_page()
1421 page = dequeue_huge_page_vma(h, vma, addr, avoid_reserve, chg); in alloc_huge_page()
1443 if (chg || avoid_reserve) in alloc_huge_page()
3469 long ret, chg; in hugetlb_reserve_pages() local
3491 chg = region_chg(resv_map, from, to); in hugetlb_reserve_pages()
3498 chg = to - from; in hugetlb_reserve_pages()
3504 if (chg < 0) { in hugetlb_reserve_pages()
3505 ret = chg; in hugetlb_reserve_pages()
3510 if (hugepage_subpool_get_pages(spool, chg)) { in hugetlb_reserve_pages()
3519 ret = hugetlb_acct_memory(h, chg); in hugetlb_reserve_pages()
3521 hugepage_subpool_put_pages(spool, chg); in hugetlb_reserve_pages()
3549 long chg = 0; in hugetlb_unreserve_pages() local
3553 chg = region_truncate(resv_map, offset); in hugetlb_unreserve_pages()
3558 hugepage_subpool_put_pages(spool, (chg - freed)); in hugetlb_unreserve_pages()
3559 hugetlb_acct_memory(h, -(chg - freed)); in hugetlb_unreserve_pages()