Lines Matching refs:hpage
863 static bool khugepaged_prealloc_page(struct page **hpage, bool *wait)
865 if (IS_ERR(*hpage)) {
870 *hpage = NULL;
872 } else if (*hpage) {
873 put_page(*hpage);
874 *hpage = NULL;
881 khugepaged_alloc_page(struct page **hpage, gfp_t gfp, int node)
883 VM_BUG_ON_PAGE(*hpage, *hpage);
885 *hpage = __alloc_pages_node(node, gfp, HPAGE_PMD_ORDER);
886 if (unlikely(!*hpage)) {
888 *hpage = ERR_PTR(-ENOMEM);
892 prep_transhuge_page(*hpage);
894 return *hpage;
915 struct page *hpage;
918 hpage = alloc_khugepaged_hugepage();
919 if (!hpage) {
928 } while (unlikely(!hpage) && likely(khugepaged_enabled()));
930 return hpage;
933 static bool khugepaged_prealloc_page(struct page **hpage, bool *wait)
936 * If the hpage allocated earlier was briefly exposed in page cache
939 * finding the hpage reused for the same mapping at a different offset.
942 if (*hpage && page_count(*hpage) > 1) {
943 put_page(*hpage);
944 *hpage = NULL;
947 if (!*hpage)
948 *hpage = khugepaged_alloc_hugepage(wait);
950 if (unlikely(!*hpage))
957 khugepaged_alloc_page(struct page **hpage, gfp_t gfp, int node)
959 VM_BUG_ON(!*hpage);
961 return *hpage;
1063 struct page **hpage,
1089 new_page = khugepaged_alloc_page(hpage, gfp, node);
1215 *hpage = NULL;
1222 if (!IS_ERR_OR_NULL(*hpage))
1223 mem_cgroup_uncharge(*hpage);
1233 struct page **hpage)
1382 collapse_huge_page(mm, address, hpage, node,
1445 struct page *hpage;
1466 hpage = find_lock_page(vma->vm_file->f_mapping,
1468 if (!hpage)
1471 if (!PageHead(hpage))
1510 * page table, but the new page will not be a subpage of hpage.
1512 if (hpage + i != page)
1532 page_ref_sub(hpage, count);
1533 add_mm_counter(vma->vm_mm, mm_counter_file(hpage), -count);
1555 unlock_page(hpage);
1556 put_page(hpage);
1677 struct page **hpage, int node)
1694 new_page = khugepaged_alloc_page(hpage, gfp, node);
1960 *hpage = NULL;
2007 if (!IS_ERR_OR_NULL(*hpage))
2008 mem_cgroup_uncharge(*hpage);
2013 struct file *file, pgoff_t start, struct page **hpage)
2081 collapse_file(mm, file, start, hpage, node);
2089 struct file *file, pgoff_t start, struct page **hpage)
2101 struct page **hpage)
2177 khugepaged_scan_file(mm, file, pgoff, hpage);
2182 hpage);
2240 struct page *hpage = NULL;
2250 if (!khugepaged_prealloc_page(&hpage, &wait))
2264 &hpage);
2270 if (!IS_ERR_OR_NULL(hpage))
2271 put_page(hpage);