*/
ratio = (unsigned long)SWAP_CLUSTER_MAX * zone->nr_active /
((zone->nr_inactive | 1) * 2);
+
atomic_add(ratio+1, &zone->nr_scan_active);
count = atomic_read(&zone->nr_scan_active);
if (count >= SWAP_CLUSTER_MAX) {
- /*
- * Don't try to bring down too many pages in one attempt.
- * If this fails, the caller will increase `priority' and
- * we'll try again, with an increased chance of reclaiming
- * mapped memory.
- */
- if (count > SWAP_CLUSTER_MAX * 4)
- count = SWAP_CLUSTER_MAX * 4;
atomic_set(&zone->nr_scan_active, 0);
refill_inactive_zone(zone, count, ps);
}