aboutsummaryrefslogtreecommitdiff
path: root/mm/compaction.c
diff options
context:
space:
mode:
authorGravatar Kirill A. Shutemov <kirill.shutemov@linux.intel.com> 2023-12-28 17:47:03 +0300
committerGravatar Andrew Morton <akpm@linux-foundation.org> 2024-01-08 15:27:15 -0800
commitfd37721803c6e73619108f76ad2e12a9aa5fafaf (patch)
tree9f4b4af44314d4e0c38bda7a6558abed65186260 /mm/compaction.c
parentselftests/mm: add separate UFFDIO_MOVE test for PMD splitting (diff)
downloadlinux-fd37721803c6e73619108f76ad2e12a9aa5fafaf.tar.gz
linux-fd37721803c6e73619108f76ad2e12a9aa5fafaf.tar.bz2
linux-fd37721803c6e73619108f76ad2e12a9aa5fafaf.zip
mm, treewide: introduce NR_PAGE_ORDERS
NR_PAGE_ORDERS defines the number of page orders supported by the page allocator, ranging from 0 to MAX_ORDER, MAX_ORDER + 1 in total. NR_PAGE_ORDERS assists in defining arrays of page orders and allows for more natural iteration over them. [kirill.shutemov@linux.intel.com: fixup for kerneldoc warning] Link: https://lkml.kernel.org/r/20240101111512.7empzyifq7kxtzk3@box Link: https://lkml.kernel.org/r/20231228144704.14033-1-kirill.shutemov@linux.intel.com Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Reviewed-by: Zi Yan <ziy@nvidia.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r--mm/compaction.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index de15a2ef0af5..24f8eb4d6260 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -2229,7 +2229,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;