@@ -1383,55 +1383,54 @@ enum page_references {
1383
1383
PAGEREF_ACTIVATE ,
1384
1384
};
1385
1385
1386
- static enum page_references page_check_references (struct page * page ,
1386
+ static enum page_references folio_check_references (struct folio * folio ,
1387
1387
struct scan_control * sc )
1388
1388
{
1389
- struct folio * folio = page_folio (page );
1390
- int referenced_ptes , referenced_page ;
1389
+ int referenced_ptes , referenced_folio ;
1391
1390
unsigned long vm_flags ;
1392
1391
1393
1392
referenced_ptes = folio_referenced (folio , 1 , sc -> target_mem_cgroup ,
1394
1393
& vm_flags );
1395
- referenced_page = TestClearPageReferenced ( page );
1394
+ referenced_folio = folio_test_clear_referenced ( folio );
1396
1395
1397
1396
/*
1398
- * The supposedly reclaimable page was found to be in a VM_LOCKED vma.
1399
- * Let the page , now marked Mlocked, be moved to the unevictable list.
1397
+ * The supposedly reclaimable folio was found to be in a VM_LOCKED vma.
1398
+ * Let the folio , now marked Mlocked, be moved to the unevictable list.
1400
1399
*/
1401
1400
if (vm_flags & VM_LOCKED )
1402
1401
return PAGEREF_ACTIVATE ;
1403
1402
1404
1403
if (referenced_ptes ) {
1405
1404
/*
1406
- * All mapped pages start out with page table
1405
+ * All mapped folios start out with page table
1407
1406
* references from the instantiating fault, so we need
1408
- * to look twice if a mapped file page is used more
1407
+ * to look twice if a mapped file folio is used more
1409
1408
* than once.
1410
1409
*
1411
1410
* Mark it and spare it for another trip around the
1412
1411
* inactive list. Another page table reference will
1413
1412
* lead to its activation.
1414
1413
*
1415
- * Note: the mark is set for activated pages as well
1416
- * so that recently deactivated but used pages are
1414
+ * Note: the mark is set for activated folios as well
1415
+ * so that recently deactivated but used folios are
1417
1416
* quickly recovered.
1418
1417
*/
1419
- SetPageReferenced ( page );
1418
+ folio_set_referenced ( folio );
1420
1419
1421
- if (referenced_page || referenced_ptes > 1 )
1420
+ if (referenced_folio || referenced_ptes > 1 )
1422
1421
return PAGEREF_ACTIVATE ;
1423
1422
1424
1423
/*
1425
- * Activate file-backed executable pages after first usage.
1424
+ * Activate file-backed executable folios after first usage.
1426
1425
*/
1427
- if ((vm_flags & VM_EXEC ) && !PageSwapBacked ( page ))
1426
+ if ((vm_flags & VM_EXEC ) && !folio_test_swapbacked ( folio ))
1428
1427
return PAGEREF_ACTIVATE ;
1429
1428
1430
1429
return PAGEREF_KEEP ;
1431
1430
}
1432
1431
1433
- /* Reclaim if clean, defer dirty pages to writeback */
1434
- if (referenced_page && !PageSwapBacked ( page ))
1432
+ /* Reclaim if clean, defer dirty folios to writeback */
1433
+ if (referenced_folio && !folio_test_swapbacked ( folio ))
1435
1434
return PAGEREF_RECLAIM_CLEAN ;
1436
1435
1437
1436
return PAGEREF_RECLAIM ;
@@ -1671,7 +1670,7 @@ static unsigned int shrink_page_list(struct list_head *page_list,
1671
1670
}
1672
1671
1673
1672
if (!ignore_references )
1674
- references = page_check_references ( page , sc );
1673
+ references = folio_check_references ( folio , sc );
1675
1674
1676
1675
switch (references ) {
1677
1676
case PAGEREF_ACTIVATE :
0 commit comments