mm/page_alloc: remove VM_BUG_ON()s from pindex helpers
Subsystems (2)
PATCH v2 1/1 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.
---
Changes in v2:
- Rebased onto mm-new, removed VM_BUG_ON()s
- Link to v1: https://lore.kernel.org/r/[email protected]
--- mm/page_alloc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
mm/page_alloc.c +1 -8
@@ -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,
Signature · 1 line
Brendan Jackman <[email protected]>
Quoted 6 lines · Brendan Jackman
Vlastimil pointed out that the VM_BUG_ON()s have fallen out of favour, so remove them.
Suggested-by Vlastimil Babka (SUSE) <[email protected]>Signed-off-by Brendan Jackman <[email protected]>
Thanks.
Quoted 42 lines
---
Changes in v2:
- Rebased onto mm-new, removed VM_BUG_ON()s
- Link to v1: https://lore.kernel.org/r/[email protected]--- mm/page_alloc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)mm/page_alloc.c +1
-9@@ -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-c3ae0381d58bBest regards,
Quoted 7 lines · Brendan Jackman
Vlastimil pointed out that the VM_BUG_ON()s have fallen out of favour, so remove them.
Suggested-by Vlastimil Babka (SUSE) <[email protected]>Signed-off-by Brendan Jackman <[email protected]>---
Signature · 3 lines
Cheers, David