Commit f76a4338 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] kwsapd can free too much memory

We need to subtract the number of freed slab pages from the number of pages
to free, not add it.
parent 6f3a72d6
...@@ -921,7 +921,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, struct page_state *ps) ...@@ -921,7 +921,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, struct page_state *ps)
if (i < ZONE_HIGHMEM) { if (i < ZONE_HIGHMEM) {
reclaim_state->reclaimed_slab = 0; reclaim_state->reclaimed_slab = 0;
shrink_slab(max_scan + nr_mapped, GFP_KERNEL); shrink_slab(max_scan + nr_mapped, GFP_KERNEL);
to_free += reclaim_state->reclaimed_slab; to_free -= reclaim_state->reclaimed_slab;
} }
if (zone->all_unreclaimable) if (zone->all_unreclaimable)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment