blk-throttle: Fix that bps of child could exceed bps limited in parent
[linux-2.6-microblaze.git] / mm / hugetlb.c
index 546df97..582ec75 100644 (file)
@@ -6361,8 +6361,10 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
                         * tables. If the huge page is present, then the tail
                         * pages must also be present. The ptl prevents the
                         * head page and tail pages from being rearranged in
-                        * any way. So this page must be available at this
-                        * point, unless the page refcount overflowed:
+                        * any way. As this is hugetlb, the pages will never
+                        * be p2pdma or not longterm pinable. So this page
+                        * must be available at this point, unless the page
+                        * refcount overflowed:
                         */
                        if (WARN_ON_ONCE(!try_grab_folio(pages[i], refs,
                                                         flags))) {
@@ -7243,14 +7245,15 @@ retry:
                page = pte_page(pte) +
                        ((address & ~huge_page_mask(h)) >> PAGE_SHIFT);
                /*
-                * try_grab_page() should always succeed here, because: a) we
-                * hold the pmd (ptl) lock, and b) we've just checked that the
-                * huge pmd (head) page is present in the page tables. The ptl
-                * prevents the head page and tail pages from being rearranged
-                * in any way. So this page must be available at this point,
-                * unless the page refcount overflowed:
+                * try_grab_page() should always be able to get the page here,
+                * because: a) we hold the pmd (ptl) lock, and b) we've just
+                * checked that the huge pmd (head) page is present in the
+                * page tables. The ptl prevents the head page and tail pages
+                * from being rearranged in any way. So this page must be
+                * available at this point, unless the page refcount
+                * overflowed:
                 */
-               if (WARN_ON_ONCE(!try_grab_page(page, flags))) {
+               if (try_grab_page(page, flags)) {
                        page = NULL;
                        goto out;
                }
@@ -7288,7 +7291,7 @@ retry:
        pte = huge_ptep_get((pte_t *)pud);
        if (pte_present(pte)) {
                page = pud_page(*pud) + ((address & ~PUD_MASK) >> PAGE_SHIFT);
-               if (WARN_ON_ONCE(!try_grab_page(page, flags))) {
+               if (try_grab_page(page, flags)) {
                        page = NULL;
                        goto out;
                }