Skip to content

RFC Slight improvements for OOM/Futex

Nico Pache linux-mm lkml llvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm: change vma_is_anonymous to vma_is_private_anonarch/powerpc/mm/book3s64/pgtable.c fs/userfaultfd.c include/linux/huge_mm.h +10 more+29 -293 replies
2/3futex: exit: Print a warning when futex_cleanup failskernel/futex/core.c+26 -185 replies
3/3exit: Check for MMF_OOM_SKIP in exit_mmapmm/mmap.c+2 -13 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/3] Slight improvements for OOM/Futex

The following 3 patches were developed while working on the OOM/Futex fix.

Patch 1: This is a nonfunctional change. The vma_is_anonymous function originally led to some confusion about what the oom reaper is checking for in __oom_reap_task_mm. This patch makes that function name more verbose.

Patch 2: Futex cleanup was designed with silent failures. Printing this failure would have led to more quickly finding the issue. This introduces a pr_info if the exit path has any issues walking the userspace list.

Patch 3: During the debug process I noticed that the oom_reap_task_mm function was always running twice for the same mm_struct; Once in the exit path and once in the oom_reaper. By checking the MMF_OOM_SKIP we can prevent these unnecissary double calls. I'd like some input from David Rientjes here with regards to CVE-2018-1000200, I want to make sure we are not reintroducing that CVE.

Cc Michael Ellerman <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Alexander Viro <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Logan Gunthorpe <[email protected]>
Cc Hari Bathini <[email protected]>
Cc "Aneesh Kumar K.V" <[email protected]>
Cc "Matthew Wilcox (Oracle)" <[email protected]>
Cc Yang Shi <[email protected]>
Cc Miaohe Lin <[email protected]>
Cc William Kucharski <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Darren Hart <[email protected]>
Cc Davidlohr Bueso <[email protected]>
Cc "André Almeida" <[email protected]>
Cc Arjan van de Ven <[email protected]>
Cc Ulrich Drepper <[email protected]>
Cc Michal Hocko <[email protected]>

Nico Pache (3):
mm: change vma_is_anonymous to vma_is_private_anon
futex: exit: Print a warning when futex_cleanup fails
exit: Check for MMF_OOM_SKIP in exit_mmap

 arch/powerpc/mm/book3s64/pgtable.c |  2 +-
 fs/userfaultfd.c                   |  2 +-
 include/linux/huge_mm.h            |  2 +-
 include/linux/mm.h                 |  2 +-
 kernel/futex/core.c                | 44 ++++++++++++++++++------------
 mm/gup.c                           |  4 +--
 mm/huge_memory.c                   | 10 +++----
 mm/madvise.c                       |  4 +--
 mm/memory.c                        | 10 +++----
 mm/migrate_device.c                |  6 ++--
 mm/mincore.c                       |  2 +-
 mm/mmap.c                          |  7 +++--
 mm/oom_kill.c                      |  2 +-
 mm/userfaultfd.c                   |  8 +++---
 14 files changed, 57 insertions(+), 48 deletions(-)
Signature · 1 line
2.35.1