Commit 6171369f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] shrink_all_memory() fix

The calling task must have a valid reclaim_state when running page
reclaim.  But I had forgotten about shrink_all_memory().
parent 7e3683e3
......@@ -1010,7 +1010,11 @@ int shrink_all_memory(int nr_pages)
pg_data_t *pgdat;
int nr_to_free = nr_pages;
int ret = 0;
struct reclaim_state reclaim_state = {
.reclaimed_slab = 0,
};
current->reclaim_state = &reclaim_state;
for_each_pgdat(pgdat) {
int freed;
struct page_state ps;
......@@ -1022,6 +1026,7 @@ int shrink_all_memory(int nr_pages)
if (nr_to_free <= 0)
break;
}
current->reclaim_state = NULL;
return ret;
}
#endif
......
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