diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 070c5b5cb704ffb55caff761dd99929a60d2d4c8..3138117001c205e4aca35266b762713a56795e8f 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2224,6 +2224,15 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, goto retry; } + /* + * Memcg doesn't have a dedicated reserve for atomic + * allocations. But like the global atomic pool, we need to + * put the burden of reclaim on regular allocation requests + * and let these go through as privileged allocations. + */ + if (gfp_mask & __GFP_ATOMIC) + goto force; + /* * Unlike in global OOM situations, memcg is not in a physical * memory shortage. Allow dying and OOM-killed tasks to