Do not trigger OOM-killer for high-order allocation failures
[sfrench/cifs-2.6.git] / mm / page_alloc.c
index 0bd4d82ddfffb55494bb94d5ce6120f56416e07c..3da85b81dabb32608fa065f8086de64f725f5af8 100644 (file)
@@ -1350,6 +1350,10 @@ nofail_alloc:
                if (page)
                        goto got_pg;
 
+               /* The OOM killer will not help higher order allocs so fail */
+               if (order > PAGE_ALLOC_COSTLY_ORDER)
+                       goto nopage;
+
                out_of_memory(zonelist, gfp_mask, order);
                goto restart;
        }