hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9CXS6
--------------------------------
Define NR_PAGE_ORDERS and MAX_PAGE_ORDER to avoid backport conflicts. This is part of commit fd37721803c6 ("mm, treewide: introduce NR_PAGE_ORDERS") and commit 5e0a760b4441 ("mm, treewide: rename MAX_ORDER to MAX_PAGE_ORDER")
Signed-off-by: Liu Shixin liushixin2@huawei.com --- mm/compaction.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/mm/compaction.c b/mm/compaction.c index 1a2ddc1e1a91..719481430d24 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -26,6 +26,9 @@ #include <linux/dynamic_pool.h> #include "internal.h"
+#define NR_PAGE_ORDERS (MAX_ORDER + 1) +#define MAX_PAGE_ORDER MAX_ORDER + #ifdef CONFIG_COMPACTION /* * Fragmentation score check interval for proactive compaction purposes. @@ -1000,7 +1003,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, * a valid page order. Consider only values in the * valid order range to prevent low_pfn overflow. */ - if (freepage_order > 0 && freepage_order <= MAX_ORDER) { + if (freepage_order > 0 && freepage_order <= MAX_PAGE_ORDER) { low_pfn += (1UL << freepage_order) - 1; nr_scanned += (1UL << freepage_order) - 1; } @@ -1018,7 +1021,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, if (PageCompound(page) && !cc->alloc_contig) { const unsigned int order = compound_order(page);
- if (likely(order <= MAX_ORDER)) { + if (likely(order <= MAX_PAGE_ORDER)) { low_pfn += (1UL << order) - 1; nr_scanned += (1UL << order) - 1; } @@ -2237,7 +2240,7 @@ static enum compact_result __compact_finished(struct compact_control *cc)
/* Direct compactor: Is a suitable page free? */ ret = COMPACT_NO_SUITABLE_PAGE; - for (order = cc->order; order <= MAX_ORDER; order++) { + for (order = cc->order; order < NR_PAGE_ORDERS; order++) { struct free_area *area = &cc->zone->free_area[order]; bool can_steal;