mm: memcontrol: reclaim at least once for __GFP_NORETRY
Currently, __GFP_NORETRY tries charging once and gives up before even trying to reclaim. Bring the behavior on par with the page allocator and reclaim at least once before giving up. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Hugh Dickins <hughd@google.com> Cc: Tejun Heo <tj@kernel.org> Cc: Vladimir Davydov <vdavydov@parallels.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
06b078fc06
commit
28c34c291e
1 changed files with 3 additions and 3 deletions
|
@ -2613,13 +2613,13 @@ static int mem_cgroup_try_charge(struct mem_cgroup *memcg,
|
||||||
if (!(gfp_mask & __GFP_WAIT))
|
if (!(gfp_mask & __GFP_WAIT))
|
||||||
goto nomem;
|
goto nomem;
|
||||||
|
|
||||||
if (gfp_mask & __GFP_NORETRY)
|
|
||||||
goto nomem;
|
|
||||||
|
|
||||||
nr_reclaimed = mem_cgroup_reclaim(mem_over_limit, gfp_mask, flags);
|
nr_reclaimed = mem_cgroup_reclaim(mem_over_limit, gfp_mask, flags);
|
||||||
|
|
||||||
if (mem_cgroup_margin(mem_over_limit) >= batch)
|
if (mem_cgroup_margin(mem_over_limit) >= batch)
|
||||||
goto retry;
|
goto retry;
|
||||||
|
|
||||||
|
if (gfp_mask & __GFP_NORETRY)
|
||||||
|
goto nomem;
|
||||||
/*
|
/*
|
||||||
* Even though the limit is exceeded at this point, reclaim
|
* Even though the limit is exceeded at this point, reclaim
|
||||||
* may have been able to free some pages. Retry the charge
|
* may have been able to free some pages. Retry the charge
|
||||||
|
|
Loading…
Reference in a new issue