Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mm/page_alloc: remove VM_BUG_ON()s from pindex helpers
@ 2026-05-26 11:28 Brendan Jackman
  2026-05-26 11:34 ` Vlastimil Babka (SUSE)
  2026-06-17 11:22 ` David Hildenbrand (Arm)
  0 siblings, 2 replies; 3+ messages in thread
From: Brendan Jackman @ 2026-05-26 11:28 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan
  Cc: linux-mm, linux-kernel, Brendan Jackman

Vlastimil pointed out that the VM_BUG_ON()s have fallen out of
favour, so remove them.

Suggested-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Link: https://lore.kernel.org/all/4074a816-9e75-45a6-8141-25459bcc106b@kernel.org/
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
Changes in v2:
- Rebased onto mm-new, removed VM_BUG_ON()s
- Link to v1: https://lore.kernel.org/r/20260513-page_alloc-unmapped-prep-v1-0-dacdf5402be8@google.com
---
 mm/page_alloc.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 1b5b1e556f76feadf21f3f44a9440fe883fb7651..e47679e7a9dbc772aa27f550a10aa8c0e95af55a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -653,13 +653,8 @@ static inline unsigned int order_to_pindex(int migratetype, int order)
 	if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) {
 		bool movable = migratetype == MIGRATE_MOVABLE;
 
-		if (order > PAGE_ALLOC_COSTLY_ORDER) {
-			VM_BUG_ON(!is_pmd_order(order));
-
+		if (order > PAGE_ALLOC_COSTLY_ORDER)
 			return NR_LOWORDER_PCP_LISTS + movable;
-		}
-	} else {
-		VM_BUG_ON(order > PAGE_ALLOC_COSTLY_ORDER);
 	}
 
 	return (MIGRATE_PCPTYPES * order) + migratetype;
@@ -672,8 +667,6 @@ static inline int pindex_to_order(unsigned int pindex)
 	if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) {
 		if (pindex >= NR_LOWORDER_PCP_LISTS)
 			order = HPAGE_PMD_ORDER;
-	} else {
-		VM_BUG_ON(order > PAGE_ALLOC_COSTLY_ORDER);
 	}
 
 	return order;

---
base-commit: da0a06486ac3ce47c6ffb603d2fd332229d41592
change-id: 20260512-page_alloc-unmapped-prep-c3ae0381d58b

Best regards,
-- 
Brendan Jackman <jackmanb@google.com>



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-17 11:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 11:28 [PATCH v2] mm/page_alloc: remove VM_BUG_ON()s from pindex helpers Brendan Jackman
2026-05-26 11:34 ` Vlastimil Babka (SUSE)
2026-06-17 11:22 ` David Hildenbrand (Arm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox