memcg: do not call reclaim if !__GFP_WAIT
authorVladimir Davydov <vdavydov@parallels.com>
Wed, 10 Jun 2015 18:14:46 +0000 (11:14 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Jun 2015 23:43:43 +0000 (16:43 -0700)
commit7d638093d4b0e9ef15bd78f38f11f126e773cc14
tree1b491946b967b573c0394c58032fcc38e8aeca1d
parent85bd839983778fcd0c1c043327b14a046e979b39
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: 241994ed8649 ("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>
mm/memcontrol.c