diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 65da189a433b78ba6fb77582b1d5f666b4fc0891..e0f7b94a4e9bcc638483e734590dd639dc5c1b7a 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