|
@@ -1289,20 +1289,6 @@ done:
|
|
|
return nr_reclaimed;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * We are about to scan this zone at a certain priority level. If that priority
|
|
|
- * level is smaller (ie: more urgent) than the previous priority, then note
|
|
|
- * that priority level within the zone. This is done so that when the next
|
|
|
- * process comes in to scan this zone, it will immediately start out at this
|
|
|
- * priority level rather than having to build up its own scanning priority.
|
|
|
- * Here, this priority affects only the reclaim-mapped threshold.
|
|
|
- */
|
|
|
-static inline void note_zone_scanning_priority(struct zone *zone, int priority)
|
|
|
-{
|
|
|
- if (priority < zone->prev_priority)
|
|
|
- zone->prev_priority = priority;
|
|
|
-}
|
|
|
-
|
|
|
/*
|
|
|
* This moves pages from the active list to the inactive list.
|
|
|
*
|
|
@@ -1766,17 +1752,8 @@ static bool shrink_zones(int priority, struct zonelist *zonelist,
|
|
|
if (scanning_global_lru(sc)) {
|
|
|
if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
|
|
|
continue;
|
|
|
- note_zone_scanning_priority(zone, priority);
|
|
|
-
|
|
|
if (zone->all_unreclaimable && priority != DEF_PRIORITY)
|
|
|
continue; /* Let kswapd poll it */
|
|
|
- } else {
|
|
|
- /*
|
|
|
- * Ignore cpuset limitation here. We just want to reduce
|
|
|
- * # of used pages by us regardless of memory shortage.
|
|
|
- */
|
|
|
- mem_cgroup_note_reclaim_priority(sc->mem_cgroup,
|
|
|
- priority);
|
|
|
}
|
|
|
|
|
|
shrink_zone(priority, zone, sc);
|
|
@@ -1877,17 +1854,6 @@ out:
|
|
|
if (priority < 0)
|
|
|
priority = 0;
|
|
|
|
|
|
- if (scanning_global_lru(sc)) {
|
|
|
- for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) {
|
|
|
-
|
|
|
- if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
|
|
|
- continue;
|
|
|
-
|
|
|
- zone->prev_priority = priority;
|
|
|
- }
|
|
|
- } else
|
|
|
- mem_cgroup_record_reclaim_priority(sc->mem_cgroup, priority);
|
|
|
-
|
|
|
delayacct_freepages_end();
|
|
|
put_mems_allowed();
|
|
|
|
|
@@ -2053,22 +2019,12 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order)
|
|
|
.order = order,
|
|
|
.mem_cgroup = NULL,
|
|
|
};
|
|
|
- /*
|
|
|
- * temp_priority is used to remember the scanning priority at which
|
|
|
- * this zone was successfully refilled to
|
|
|
- * free_pages == high_wmark_pages(zone).
|
|
|
- */
|
|
|
- int temp_priority[MAX_NR_ZONES];
|
|
|
-
|
|
|
loop_again:
|
|
|
total_scanned = 0;
|
|
|
sc.nr_reclaimed = 0;
|
|
|
sc.may_writepage = !laptop_mode;
|
|
|
count_vm_event(PAGEOUTRUN);
|
|
|
|
|
|
- for (i = 0; i < pgdat->nr_zones; i++)
|
|
|
- temp_priority[i] = DEF_PRIORITY;
|
|
|
-
|
|
|
for (priority = DEF_PRIORITY; priority >= 0; priority--) {
|
|
|
int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */
|
|
|
unsigned long lru_pages = 0;
|
|
@@ -2136,9 +2092,7 @@ loop_again:
|
|
|
if (zone->all_unreclaimable && priority != DEF_PRIORITY)
|
|
|
continue;
|
|
|
|
|
|
- temp_priority[i] = priority;
|
|
|
sc.nr_scanned = 0;
|
|
|
- note_zone_scanning_priority(zone, priority);
|
|
|
|
|
|
nid = pgdat->node_id;
|
|
|
zid = zone_idx(zone);
|
|
@@ -2211,16 +2165,6 @@ loop_again:
|
|
|
break;
|
|
|
}
|
|
|
out:
|
|
|
- /*
|
|
|
- * Note within each zone the priority level at which this zone was
|
|
|
- * brought into a happy state. So that the next thread which scans this
|
|
|
- * zone will start out at that priority level.
|
|
|
- */
|
|
|
- for (i = 0; i < pgdat->nr_zones; i++) {
|
|
|
- struct zone *zone = pgdat->node_zones + i;
|
|
|
-
|
|
|
- zone->prev_priority = temp_priority[i];
|
|
|
- }
|
|
|
if (!all_zones_ok) {
|
|
|
cond_resched();
|
|
|
|
|
@@ -2639,7 +2583,6 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
|
|
|
*/
|
|
|
priority = ZONE_RECLAIM_PRIORITY;
|
|
|
do {
|
|
|
- note_zone_scanning_priority(zone, priority);
|
|
|
shrink_zone(priority, zone, &sc);
|
|
|
priority--;
|
|
|
} while (priority >= 0 && sc.nr_reclaimed < nr_pages);
|