vmscan.c (08951e545918c1594434d000d88a7793e2452a9b) | vmscan.c (d7868dae893c83c50c7824bc2bc75f93d114669f) |
---|---|
1/* 2 * linux/mm/vmscan.c 3 * 4 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds 5 * 6 * Swap reorganised 29.12.95, Stephen Tweedie. 7 * kswapd added: 7.1.96 sct 8 * Removed kswapd_ctl limits, and swap out as many pages as needed --- 2496 unchanged lines hidden (view full) --- 2505 * of the zone, whichever is smaller. 2506 */ 2507 balance_gap = min(low_wmark_pages(zone), 2508 (zone->present_pages + 2509 KSWAPD_ZONE_BALANCE_GAP_RATIO-1) / 2510 KSWAPD_ZONE_BALANCE_GAP_RATIO); 2511 if (!zone_watermark_ok_safe(zone, order, 2512 high_wmark_pages(zone) + balance_gap, | 1/* 2 * linux/mm/vmscan.c 3 * 4 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds 5 * 6 * Swap reorganised 29.12.95, Stephen Tweedie. 7 * kswapd added: 7.1.96 sct 8 * Removed kswapd_ctl limits, and swap out as many pages as needed --- 2496 unchanged lines hidden (view full) --- 2505 * of the zone, whichever is smaller. 2506 */ 2507 balance_gap = min(low_wmark_pages(zone), 2508 (zone->present_pages + 2509 KSWAPD_ZONE_BALANCE_GAP_RATIO-1) / 2510 KSWAPD_ZONE_BALANCE_GAP_RATIO); 2511 if (!zone_watermark_ok_safe(zone, order, 2512 high_wmark_pages(zone) + balance_gap, |
2513 end_zone, 0)) | 2513 end_zone, 0)) { |
2514 shrink_zone(priority, zone, &sc); | 2514 shrink_zone(priority, zone, &sc); |
2515 reclaim_state->reclaimed_slab = 0; 2516 nr_slab = shrink_slab(&shrink, sc.nr_scanned, lru_pages); 2517 sc.nr_reclaimed += reclaim_state->reclaimed_slab; 2518 total_scanned += sc.nr_scanned; | |
2519 | 2515 |
2520 if (zone->all_unreclaimable) 2521 continue; 2522 if (nr_slab == 0 && 2523 !zone_reclaimable(zone)) 2524 zone->all_unreclaimable = 1; | 2516 reclaim_state->reclaimed_slab = 0; 2517 nr_slab = shrink_slab(&shrink, sc.nr_scanned, lru_pages); 2518 sc.nr_reclaimed += reclaim_state->reclaimed_slab; 2519 total_scanned += sc.nr_scanned; 2520 2521 if (nr_slab == 0 && !zone_reclaimable(zone)) 2522 zone->all_unreclaimable = 1; 2523 } 2524 |
2525 /* 2526 * If we've done a decent amount of scanning and 2527 * the reclaim ratio is low, start doing writepage 2528 * even in laptop mode 2529 */ 2530 if (total_scanned > SWAP_CLUSTER_MAX * 2 && 2531 total_scanned > sc.nr_reclaimed + sc.nr_reclaimed / 2) 2532 sc.may_writepage = 1; 2533 | 2525 /* 2526 * If we've done a decent amount of scanning and 2527 * the reclaim ratio is low, start doing writepage 2528 * even in laptop mode 2529 */ 2530 if (total_scanned > SWAP_CLUSTER_MAX * 2 && 2531 total_scanned > sc.nr_reclaimed + sc.nr_reclaimed / 2) 2532 sc.may_writepage = 1; 2533 |
2534 if (zone->all_unreclaimable) 2535 continue; 2536 |
|
2534 if (!zone_watermark_ok_safe(zone, order, 2535 high_wmark_pages(zone), end_zone, 0)) { 2536 all_zones_ok = 0; 2537 /* 2538 * We are still under min water mark. This 2539 * means that we have a GFP_ATOMIC allocation 2540 * failure risk. Hurry up! 2541 */ --- 880 unchanged lines hidden --- | 2537 if (!zone_watermark_ok_safe(zone, order, 2538 high_wmark_pages(zone), end_zone, 0)) { 2539 all_zones_ok = 0; 2540 /* 2541 * We are still under min water mark. This 2542 * means that we have a GFP_ATOMIC allocation 2543 * failure risk. Hurry up! 2544 */ --- 880 unchanged lines hidden --- |