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 | 6 +++--- mm/internal.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/mm/compaction.c b/mm/compaction.c index 1a2ddc1e1a91..ffa9a3eb0afd 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1000,7 +1000,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 +1018,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 +2237,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;
diff --git a/mm/internal.h b/mm/internal.h index 3730156306da..ddad6556dcc4 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -569,6 +569,9 @@ int split_free_page(struct page *free_page,
#if defined CONFIG_COMPACTION || defined CONFIG_CMA
+#define NR_PAGE_ORDERS (MAX_ORDER + 1) +#define MAX_PAGE_ORDER MAX_ORDER + /* * in mm/compaction.c */