diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 14c2f2017e37cc405e52cb12bc30b128997f1f8e..9da23a7ec4c00b04ced3e349e8dc8a5c6ca016b3 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2323,6 +2323,8 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, css_get_many(&memcg->css, batch); if (batch > nr_pages) refill_stock(memcg, batch - nr_pages); + if (!(gfp_mask & __GFP_WAIT)) + goto done; /* * If the hierarchy is above the normal consumption range, * make the charging task trim their excess contribution.