mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
memcg: do not call reclaim if !__GFP_WAIT
When trimming memcg consumption excess (see memory.high), we call
try_to_free_mem_cgroup_pages without checking if we are allowed to sleep
in the current context, which can result in a deadlock. Fix this.
Fixes: 241994ed86
("mm: memcontrol: default hierarchy interface for memory")
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
85bd839983
commit
7d638093d4
@ -2323,6 +2323,8 @@ done_restock:
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user