compaction.c (d2155fe54ddb6e289b4f7854df5a7d828d6efbb5) compaction.c (b55ca5264b0c0092f238e2f4f33319ba6e9901ab)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/mm/compaction.c
4 *
5 * Memory compaction for the reduction of external fragmentation. Note that
6 * this heavily depends upon page migration to do all the real heavy
7 * lifting
8 *

--- 1364 unchanged lines hidden (view full) ---

1373 }
1374
1375 return order;
1376}
1377
1378static unsigned long
1379fast_isolate_freepages(struct compact_control *cc)
1380{
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/mm/compaction.c
4 *
5 * Memory compaction for the reduction of external fragmentation. Note that
6 * this heavily depends upon page migration to do all the real heavy
7 * lifting
8 *

--- 1364 unchanged lines hidden (view full) ---

1373 }
1374
1375 return order;
1376}
1377
1378static unsigned long
1379fast_isolate_freepages(struct compact_control *cc)
1380{
1381 unsigned int limit = min(1U, freelist_scan_limit(cc) >> 1);
1381 unsigned int limit = max(1U, freelist_scan_limit(cc) >> 1);
1382 unsigned int nr_scanned = 0;
1383 unsigned long low_pfn, min_pfn, highest = 0;
1384 unsigned long nr_isolated = 0;
1385 unsigned long distance;
1386 struct page *page = NULL;
1387 bool scan_start = false;
1388 int order;
1389

--- 95 unchanged lines hidden (view full) ---

1485 order = cc->search_order + 1;
1486 page = NULL;
1487 }
1488 }
1489
1490 spin_unlock_irqrestore(&cc->zone->lock, flags);
1491
1492 /*
1382 unsigned int nr_scanned = 0;
1383 unsigned long low_pfn, min_pfn, highest = 0;
1384 unsigned long nr_isolated = 0;
1385 unsigned long distance;
1386 struct page *page = NULL;
1387 bool scan_start = false;
1388 int order;
1389

--- 95 unchanged lines hidden (view full) ---

1485 order = cc->search_order + 1;
1486 page = NULL;
1487 }
1488 }
1489
1490 spin_unlock_irqrestore(&cc->zone->lock, flags);
1491
1492 /*
1493 * Smaller scan on next order so the total scan ig related
1493 * Smaller scan on next order so the total scan is related
1494 * to freelist_scan_limit.
1495 */
1496 if (order_scanned >= limit)
1494 * to freelist_scan_limit.
1495 */
1496 if (order_scanned >= limit)
1497 limit = min(1U, limit >> 1);
1497 limit = max(1U, limit >> 1);
1498 }
1499
1500 if (!page) {
1501 cc->fast_search_fail++;
1502 if (scan_start) {
1503 /*
1504 * Use the highest PFN found above min. If one was
1505 * not found, be pessimistic for direct compaction

--- 1509 unchanged lines hidden ---
1498 }
1499
1500 if (!page) {
1501 cc->fast_search_fail++;
1502 if (scan_start) {
1503 /*
1504 * Use the highest PFN found above min. If one was
1505 * not found, be pessimistic for direct compaction

--- 1509 unchanged lines hidden ---