nios2: Use preempt_schedule_irq
[cascardo/linux.git] / fs / seq_file.c
index 353948b..dbf3a59 100644 (file)
@@ -25,7 +25,11 @@ static void *seq_buf_alloc(unsigned long size)
 {
        void *buf;
 
-       buf = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
+       /*
+        * __GFP_NORETRY to avoid oom-killings with high-order allocations -
+        * it's better to fall back to vmalloc() than to kill things.
+        */
+       buf = kmalloc(size, GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN);
        if (!buf && size > PAGE_SIZE)
                buf = vmalloc(size);
        return buf;