arm64: dts: rockchip: add gmac support for rk3328-evb
[firefly-linux-kernel-4.4.55.git] / mm / memcontrol.c
index 1e50d37ee132b3768ecb052486e0dd62f2a0d066..17dfe70f3309778e92d6968ed87b15d4baa7897a 100644 (file)
@@ -2055,6 +2055,15 @@ retry:
                     current->flags & PF_EXITING))
                goto force;
 
+       /*
+        * Prevent unbounded recursion when reclaim operations need to
+        * allocate memory. This might exceed the limits temporarily,
+        * but we prefer facilitating memory reclaim and getting back
+        * under the limit over triggering OOM kills in these cases.
+        */
+       if (unlikely(current->flags & PF_MEMALLOC))
+               goto force;
+
        if (unlikely(task_in_memcg_oom(current)))
                goto nomem;