linux/mm
Michal Hocko 696453e666 mm, oom: task_will_free_mem should skip oom_reaped tasks
The 0-day robot has encountered the following:

   Out of memory: Kill process 3914 (trinity-c0) score 167 or sacrifice child
   Killed process 3914 (trinity-c0) total-vm:55864kB, anon-rss:1512kB, file-rss:1088kB, shmem-rss:25616kB
   oom_reaper: reaped process 3914 (trinity-c0), now anon-rss:0kB, file-rss:0kB, shmem-rss:26488kB
   oom_reaper: reaped process 3914 (trinity-c0), now anon-rss:0kB, file-rss:0kB, shmem-rss:26900kB
   oom_reaper: reaped process 3914 (trinity-c0), now anon-rss:0kB, file-rss:0kB, shmem-rss:26900kB
   oom_reaper: reaped process 3914 (trinity-c0), now anon-rss:0kB, file-rss:0kB, shmem-rss:27296kB
   oom_reaper: reaped process 3914 (trinity-c0), now anon-rss:0kB, file-rss:0kB, shmem-rss:28148kB

oom_reaper is trying to reap the same task again and again.

This is possible only when the oom killer is bypassed because of
task_will_free_mem because we skip over tasks with MMF_OOM_REAPED
already set during select_bad_process.  Teach task_will_free_mem to skip
over MMF_OOM_REAPED tasks as well because they will be unlikely to free
anything more.

Analyzed by Tetsuo Handa.

Link: http://lkml.kernel.org/r/1466426628-15074-9-git-send-email-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-07-28 16:07:41 -07:00
..
kasan kasan/quarantine: fix bugs on qlist_move_cache() 2016-07-15 14:54:27 +09:00
Kconfig thp: introduce CONFIG_TRANSPARENT_HUGE_PAGECACHE 2016-07-26 16:19:19 -07:00
Kconfig.debug
Makefile thp: extract khugepaged from mm/huge_memory.c 2016-07-26 16:19:19 -07:00
backing-dev.c mm: throttle on IO only when there are too many dirty and writeback pages 2016-05-20 17:58:30 -07:00
balloon_compaction.c mm: balloon: use general non-lru movable page feature 2016-07-26 16:19:19 -07:00
bootmem.c
cleancache.c
cma.c mm/cma: silence warnings due to max() usage 2016-05-27 14:49:37 -07:00
cma.h
cma_debug.c
compaction.c mm/page_alloc: introduce post allocation processing on page allocator 2016-07-26 16:19:19 -07:00
debug.c
debug_page_ref.c
dmapool.c
early_ioremap.c
fadvise.c mm/fadvise.c: do not discard partial pages with POSIX_FADV_DONTNEED 2016-06-09 14:23:11 -07:00
failslab.c
filemap.c shmem: add huge pages support 2016-07-26 16:19:19 -07:00
frame_vector.c
frontswap.c mm, frontswap: convert frontswap_enabled to static key 2016-07-26 16:19:19 -07:00
gup.c thp: file pages support for split_huge_page() 2016-07-26 16:19:19 -07:00
highmem.c mm/highmem: make nr_free_highpages() handles all highmem zones by itself 2016-05-19 19:12:14 -07:00
huge_memory.c thp: fix comments of __pmd_trans_huge_lock() 2016-07-26 16:19:19 -07:00
hugetlb.c Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
hugetlb_cgroup.c mm, hugetlb_cgroup: round limit_in_bytes down to hugepage size 2016-05-20 17:58:30 -07:00
hwpoison-inject.c
init-mm.c
internal.h mm: introduce fault_env 2016-07-26 16:19:19 -07:00
interval_tree.c
khugepaged.c mm, thp: convert from optimistic swapin collapsing to conservative 2016-07-26 16:19:19 -07:00
kmemcheck.c
kmemleak-test.c
kmemleak.c mm: prevent KASAN false positives in kmemleak 2016-06-24 17:23:52 -07:00
ksm.c mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
list_lru.c
maccess.c x86: remove more uaccess_32.h complexity 2016-05-22 17:21:27 -07:00
madvise.c mm: make mmap_sem for write waits killable for mm syscalls 2016-05-23 17:04:14 -07:00
memblock.c mm/memblock.c:memblock_add_range(): if nr_new is 0 just return 2016-07-26 16:19:19 -07:00
memcontrol.c mm, oom: fortify task_will_free_mem() 2016-07-28 16:07:41 -07:00
memory-failure.c mm/memory-failure.c: replace "MCE" with "Memory failure" 2016-05-20 17:58:30 -07:00
memory.c thp: introduce CONFIG_TRANSPARENT_HUGE_PAGECACHE 2016-07-26 16:19:19 -07:00
memory_hotplug.c memory-hotplug: more general validation of zone during online 2016-07-26 16:19:19 -07:00
mempolicy.c shmem: add huge pages support 2016-07-26 16:19:19 -07:00
mempool.c mm: mempool: kasan: don't poot mempool objects in quarantine 2016-06-24 17:23:52 -07:00
memtest.c
migrate.c mm: introduce do_set_pmd() 2016-07-26 16:19:19 -07:00
mincore.c
mlock.c mm: make mmap_sem for write waits killable for mm syscalls 2016-05-23 17:04:14 -07:00
mm_init.c
mmap.c shmem: get_unmapped_area align huge page 2016-07-26 16:19:19 -07:00
mmu_context.c
mmu_notifier.c
mmzone.c mm, page_alloc: inline the fast path of the zonelist iterator 2016-05-19 19:12:14 -07:00
mprotect.c mm: thp: check pmd_trans_unstable() after split_huge_pmd() 2016-07-26 16:19:19 -07:00
mremap.c mm: thp: check pmd_trans_unstable() after split_huge_pmd() 2016-07-26 16:19:19 -07:00
msync.c
nobootmem.c
nommu.c mm: introduce fault_env 2016-07-26 16:19:19 -07:00
oom_kill.c mm, oom: task_will_free_mem should skip oom_reaped tasks 2016-07-28 16:07:41 -07:00
page-writeback.c shmem: add huge pages support 2016-07-26 16:19:19 -07:00
page_alloc.c mm, rmap: account shmem thp pages 2016-07-26 16:19:19 -07:00
page_counter.c
page_ext.c mm: use early_pfn_to_nid in page_ext_init 2016-05-27 14:49:37 -07:00
page_idle.c
page_io.c block, fs, mm, drivers: use bio set/get op accessors 2016-06-07 13:41:38 -06:00
page_isolation.c mm/page_isolation: clean up confused code 2016-07-26 16:19:19 -07:00
page_owner.c mm/page_owner: use stackdepot to store stacktrace 2016-07-26 16:19:19 -07:00
page_poison.c mm: check the return value of lookup_page_ext for all call sites 2016-06-03 15:06:22 -07:00
pagewalk.c
percpu-km.c
percpu-vm.c
percpu.c percpu: fix synchronization between synchronous map extension and chunk destruction 2016-05-25 11:48:25 -04:00
pgtable-generic.c
process_vm_access.c
quicklist.c
readahead.c mm, memcg: use consistent gfp flags during readahead 2016-07-26 16:19:19 -07:00
rmap.c mm, rmap: account shmem thp pages 2016-07-26 16:19:19 -07:00
shmem.c shmem: split huge pages beyond i_size under memory pressure 2016-07-26 16:19:19 -07:00
slab.c mm/slab: use list_move instead of list_del/list_add 2016-07-26 16:19:19 -07:00
slab.h mm: memcontrol: cleanup kmem charge functions 2016-07-26 16:19:19 -07:00
slab_common.c mm: charge/uncharge kmemcg from generic page allocator paths 2016-07-26 16:19:19 -07:00
slob.c
slub.c mm: charge/uncharge kmemcg from generic page allocator paths 2016-07-26 16:19:19 -07:00
sparse-vmemmap.c
sparse.c
swap.c shmem: add huge pages support 2016-07-26 16:19:19 -07:00
swap_cgroup.c
swap_state.c mm: thp: broken page count after commit aa88b68c3b 2016-06-09 14:23:11 -07:00
swapfile.c mm, frontswap: convert frontswap_enabled to static key 2016-07-26 16:19:19 -07:00
truncate.c truncate: handle file thp 2016-07-26 16:19:19 -07:00
userfaultfd.c
util.c rmap: support file thp 2016-07-26 16:19:19 -07:00
vmacache.c
vmalloc.c mm: charge/uncharge kmemcg from generic page allocator paths 2016-07-26 16:19:19 -07:00
vmpressure.c
vmscan.c vmscan: split file huge pages before paging them out 2016-07-26 16:19:19 -07:00
vmstat.c mm, rmap: account shmem thp pages 2016-07-26 16:19:19 -07:00
workingset.c mm: workingset: printk missing log level, use pr_info() 2016-07-15 14:54:27 +09:00
z3fold.c mm/z3fold.c: avoid modifying HEADLESS page and minor cleanup 2016-06-03 16:02:55 -07:00
zbud.c
zpool.c
zsmalloc.c mm: fix build warnings in <linux/compaction.h> 2016-07-26 16:19:19 -07:00
zswap.c mm/zswap: use workqueue to destroy pool 2016-05-20 17:58:30 -07:00