]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] vm: scan slab in response to highmem scanning
authorAndrew Morton <akpm@osdl.org>
Fri, 12 Mar 2004 00:23:38 +0000 (16:23 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 12 Mar 2004 00:23:38 +0000 (16:23 -0800)
The patch which went in six months or so back which said "only reclaim slab
if we're scanning lowmem pagecache" was wrong.  I must have been asleep at
the time.

We do need to scan slab in response to highmem page reclaim as well.  Because
all the math is based around the total amount of memory in the machine, and
we know that if we're performing highmem page reclaim then the lower zones
have no free memory.

mm/vmscan.c

index 375d2bbf4cd19611ab01346cb29720b82d914d6b..ccddf9ac3d59abe89ed7d8975c97105d8f3ee79d 100644 (file)
@@ -872,12 +872,10 @@ int try_to_free_pages(struct zone **zones,
                get_page_state(&ps);
                nr_reclaimed += shrink_caches(zones, priority, &total_scanned,
                                                gfp_mask, nr_pages, &ps);
-               if (zones[0] - zones[0]->zone_pgdat->node_zones < ZONE_HIGHMEM) {
-                       shrink_slab(total_scanned, gfp_mask);
-                       if (reclaim_state) {
-                               nr_reclaimed += reclaim_state->reclaimed_slab;
-                               reclaim_state->reclaimed_slab = 0;
-                       }
+               shrink_slab(total_scanned, gfp_mask);
+               if (reclaim_state) {
+                       nr_reclaimed += reclaim_state->reclaimed_slab;
+                       reclaim_state->reclaimed_slab = 0;
                }
                if (nr_reclaimed >= nr_pages) {
                        ret = 1;
@@ -964,11 +962,9 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, struct page_state *ps)
                                max_scan = SWAP_CLUSTER_MAX;
                        reclaimed = shrink_zone(zone, max_scan, GFP_KERNEL,
                                        to_reclaim, &total_scanned, ps);
-                       if (i < ZONE_HIGHMEM) {
-                               reclaim_state->reclaimed_slab = 0;
-                               shrink_slab(total_scanned, GFP_KERNEL);
-                               reclaimed += reclaim_state->reclaimed_slab;
-                       }
+                       reclaim_state->reclaimed_slab = 0;
+                       shrink_slab(total_scanned, GFP_KERNEL);
+                       reclaimed += reclaim_state->reclaimed_slab;
                        to_free -= reclaimed;
                        if (zone->all_unreclaimable)
                                continue;