Skip to content

RFC fortify oom killer even more

Michal Hocko linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 19 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6oom: keep mm of the killed task availableinclude/linux/sched.h kernel/fork.c mm/oom_kill.c+31 -404 replies
2/6oom, suspend: fix oom_killer_disable vs. pm suspend properlyinclude/linux/oom.h kernel/power/process.c mm/oom_kill.c+24 -280 replies
3/6exit, oom: postpone exit_oom_victim to laterkernel/exit.c+3 -20 replies
4/6oom, oom_reaper: consider mmget_not_zero as a failuremm/oom_kill.c+3 -40 replies
5/6vhost, mm: make sure that oom_reaper doesn't reap memory read by vhostdrivers/vhost/scsi.c drivers/vhost/vhost.c include/linux/sched.h +3 more+51 -1015 replies
6/6oom, oom_reaper: allow to reap mm shared by the kthreadsmm/mmu_context.c mm/oom_kill.c+13 -70 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/6] fortify oom killer even more

Hi,
I am sending this pile as an RFC and I hope it will make a good foundation to hopefully plug the remaining holes which could lead to oom lockups for CONFIG_MMU.

There are two main parts patches 1-4 and the 5-6. The first pile focuses on moving decisions about oom victims more to mm_struct. Especially the part when there is an oom victim noticed and we decide whether to select new victim. Patch 1 remembers the mm at the time oom victim is selected and it is stable for the rest of the process group life time. This allows some simplifications.

The later part is about kthread vs. oom_reaper interaction. It seems that the only use_mm() user which needs fixing is vhost and that is fixable. Then we can remove the kthread restriction and so basically the every oom victim will be reapable now (well except the weird cases where the mm is shared with init but I consider that uninteresting).

I haven't tested this properly yet. I will be mostly offline next week but definitely plan to test it later on. Right now I would appreciated feedback/review. If this looks OK then I would like to target it for 4.9.

The series is based on top of the current mmotm (2016-06-24-15-53) +
http://lkml.kernel.org/r/[email protected]

Thanks!

Michal Hocko (6):
oom: keep mm of the killed task available
oom, suspend: fix oom_killer_disable vs. pm suspend properly exit, oom: postpone exit_oom_victim to later
oom, oom_reaper: consider mmget_not_zero as a failure vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost oom, oom_reaper: allow to reap mm shared by the kthreads

 drivers/vhost/scsi.c    |   2 +-
 drivers/vhost/vhost.c   |  18 +++----
 include/linux/oom.h     |   2 +-
 include/linux/sched.h   |   3 ++
 include/linux/uaccess.h |  22 +++++++++
 include/linux/uio.h     |  10 ++++
 kernel/exit.c           |   5 +-
 kernel/fork.c           |   2 +
 kernel/power/process.c  |  17 ++-----
 mm/mmu_context.c        |   6 +++
 mm/oom_kill.c           | 127 ++++++++++++++++++++++++------------------------
 11 files changed, 124 insertions(+), 90 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>