mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
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 <jackmanb@google.com> Suggested-by: Vlastimil Babka (SUSE) <vbabka@kernel.org> Link: https://lore.kernel.org/all/4074a816-9e75-45a6-8141-25459bcc106b@kernel.org/ Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Zi Yan <ziy@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
6cbdd9726f
commit
62f272d2fb
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user