diff mbox series

[RFC,3/3] mm: hugetlb: Remove unnecessary check for avoid_reserve

Message ID 5d0ededd93c4cd33a78c43c12d5075be2eea9674.1728684491.git.ackerleytng@google.com (mailing list archive)
State New
Headers show
Series Reduce dependence on vmas deep in hugetlb allocation code | expand

Commit Message

Ackerley Tng Oct. 11, 2024, 11:22 p.m. UTC
If avoid_reserve is true, gbl_chg is not used anyway, so there is no
point in setting gbl_chg.

Signed-off-by: Ackerley Tng <ackerleytng@google.com>
---
 mm/hugetlb.c | 10 ----------
 1 file changed, 10 deletions(-)

--
2.47.0.rc1.288.g06298d1525-goog
diff mbox series

Patch

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 47c421eba112..a2e2b770a018 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3009,16 +3009,6 @@  struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma,
 		if (gbl_chg < 0)
 			goto out_end_reservation;

-		/*
-		 * Even though there was no reservation in the region/reserve
-		 * map, there could be reservations associated with the
-		 * subpool that can be used.  This would be indicated if the
-		 * return value of hugepage_subpool_get_pages() is zero.
-		 * However, if avoid_reserve is specified we still avoid even
-		 * the subpool reservations.
-		 */
-		if (avoid_reserve)
-			gbl_chg = 1;
 	}

 	/* If this allocation is not consuming a reservation, charge it now.