From: Brendan Jackman Date: Tue, 26 May 2026 11:28:36 +0000 (+0000) Subject: mm/page_alloc: remove VM_BUG_ON()s from pindex helpers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62f272d2fbffa7494e4d01c35a3a7b30d71b30a1;p=thirdparty%2Flinux.git mm/page_alloc: remove VM_BUG_ON()s from pindex helpers Vlastimil pointed out that the VM_BUG_ON()s have fallen out of favour, so remove them. Link: https://lore.kernel.org/20260526-page_alloc-unmapped-prep-v2-1-412f4d486115@google.com Signed-off-by: Brendan Jackman Suggested-by: Vlastimil Babka (SUSE) Link: https://lore.kernel.org/all/4074a816-9e75-45a6-8141-25459bcc106b@kernel.org/ Reviewed-by: Vlastimil Babka (SUSE) Cc: Johannes Weiner Cc: Michal Hocko Cc: Suren Baghdasaryan Cc: Zi Yan Signed-off-by: Andrew Morton --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 7e3c79e79e5b..97cb95820592 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;