Skip to content
Snippets Groups Projects
Select Git revision
  • 02fd2d04b0623019ecd449c5965463700ff7735d
  • experimental default protected
  • v2023.2.5-ffs
  • nrb/ex400-remove-wps
  • nrb/airmax-test
  • v2023.2.4-ffs
  • nrb/ar9344-reset-sequence
  • autinerd/experimental-openwrt-24.10
  • v2023.2.3-ffs
  • v2023.2.2-ffs
  • v2023.2-ffs
  • v2023.1-ffs
  • v2022.1.4-ffs
  • feature/addMikrotikwAP
  • v2022.1.3-ffs
  • v2021.1.2-ffs
  • v2022.1.1-ffs
  • master protected
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • v2023.2.5-ffs0.1
  • experimental-2025-06-08
  • experimental-2025-06-08-base
  • experimental-2025-06-06
  • experimental-2025-06-06-base
  • experimental-2025-05-27
  • experimental-2025-05-27-base
  • experimental-2025-05-18
  • experimental-2025-05-18-base
  • experimental-2025-05-15
  • experimental-2025-05-15-base
  • experimental-2025-05-13
  • experimental-2025-05-13-base
  • experimental-2025-05-08
  • experimental-2025-05-08-base
  • experimental-2025-05-05
  • experimental-2025-05-05-base
  • experimental-2025-05-02
  • experimental-2025-05-02-base
  • experimental-2025-05-01
41 results

push_pkg.sh

Blame
  • 0012-kernel-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-processes.patch 2.87 KiB
    From: Matthias Schiffer <mschiffer@universe-factory.net>
    Date: Mon, 4 Jan 2016 10:22:52 +0100
    Subject: kernel: fs, seq_file: fallback to vmalloc instead of oom kill processes
    
    diff --git a/target/linux/generic/patches-3.18/089-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-.patch b/target/linux/generic/patches-3.18/089-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-.patch
    new file mode 100644
    index 0000000000000000000000000000000000000000..cad56f4275287b73dd5e769ea34daee064ee8d69
    --- /dev/null
    +++ b/target/linux/generic/patches-3.18/089-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-.patch
    @@ -0,0 +1,53 @@
    +From 5cec38ac866bfb8775638e71a86e4d8cac30caae Mon Sep 17 00:00:00 2001
    +Message-Id: <5cec38ac866bfb8775638e71a86e4d8cac30caae.1451899087.git.mschiffer@universe-factory.net>
    +From: David Rientjes <rientjes@google.com>
    +Date: Fri, 12 Dec 2014 16:56:16 -0800
    +Subject: [PATCH] fs, seq_file: fallback to vmalloc instead of oom kill
    + processes
    +
    +Since commit 058504edd026 ("fs/seq_file: fallback to vmalloc allocation"),
    +seq_buf_alloc() falls back to vmalloc() when the kmalloc() for contiguous
    +memory fails.  This was done to address order-4 slab allocations for
    +reading /proc/stat on large machines and noticed because
    +PAGE_ALLOC_COSTLY_ORDER < 4, so there is no infinite loop in the page
    +allocator when allocating new slab for such high-order allocations.
    +
    +Contiguous memory isn't necessary for caller of seq_buf_alloc(), however.
    +Other GFP_KERNEL high-order allocations that are <=
    +PAGE_ALLOC_COSTLY_ORDER will simply loop forever in the page allocator and
    +oom kill processes as a result.
    +
    +We don't want to kill processes so that we can allocate contiguous memory
    +in situations when contiguous memory isn't necessary.
    +
    +This patch does the kmalloc() allocation with __GFP_NORETRY for high-order
    +allocations.  This still utilizes memory compaction and direct reclaim in
    +the allocation path, the only difference is that it will fail immediately
    +instead of oom kill processes when out of memory.
    +
    +[akpm@linux-foundation.org: add comment]
    +Signed-off-by: David Rientjes <rientjes@google.com>
    +Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
    +Cc: Christoph Hellwig <hch@infradead.org>
    +Cc: Al Viro <viro@zeniv.linux.org.uk>
    +Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    +Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    +---
    + fs/seq_file.c | 6 +++++-
    + 1 file changed, 5 insertions(+), 1 deletion(-)
    +
    +--- a/fs/seq_file.c
    ++++ b/fs/seq_file.c
    +@@ -36,7 +36,11 @@ static void *seq_buf_alloc(unsigned long
    + {
    + 	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;