All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/4] mm, oom: get rid of TIF_MEMDIE
@ 2016-09-01  9:51 ` Michal Hocko
  0 siblings, 0 replies; 42+ messages in thread
From: Michal Hocko @ 2016-09-01  9:51 UTC (permalink / raw)
  To: linux-mm
  Cc: David Rientjes, Tetsuo Handa, Johannes Weiner, Andrew Morton,
	LKML, Al Viro, Michal Hocko, Oleg Nesterov

Hi,
this is an early RFC to see whether the approach I've taken is acceptable.
The series is on top of the current mmotm tree (2016-08-31-16-06). I didn't
get to test it so it might be completely broken.

The primary point of this series is to get rid of TIF_MEMDIE finally.
Recent changes in the oom proper allows for that finally, I believe. Now
that all the oom victims are reapable we are no longer depending on
ALLOC_NO_WATERMARKS because the memory held by the victim is reclaimed
asynchronously. A partial access to memory reserves should be sufficient
just to guarantee that the oom victim is not starved due to other
memory consumers. This also means that we do not have to pretend to be
conservative and give access to memory reserves only to one thread from
the process at the time. This is patch 1.

Patch 2 is a simple cleanup which turns TIF_MEMDIE users to tsk_is_oom_victim
which is process rather than thread centric. None of those callers really
requires to be thread aware AFAICS.

The tricky part then is exit_oom_victim vs. oom_killer_disable because
TIF_MEMDIE acted as a token there so we had a way to count threads from
the process. It didn't work 100% reliably and had it own issues but we
have to replace it with something which doesn't rely on counting threads
but rather find a moment when all threads have reached steady state in
do_exit. This is what patch 3 does and I would really appreciate if Oleg
could double check my thinking there. I am also CCing Al on that one
because I am moving exit_io_context up in do_exit right before exit_notify.

The last patch just removes TIF_MEMDIE from the arch code because it is
no longer needed anywhere.

I would give it some more testing but I am leaving for couple of days
and I wanted to check whether this is a sound way to go before that.

I really appreciate any feedback.

Michal Hocko (4):
      mm, oom: do not rely on TIF_MEMDIE for memory reserves access
      mm: replace TIF_MEMDIE checks by tsk_is_oom_victim
      mm, oom: do not rely on TIF_MEMDIE for exit_oom_victim
      arch: get rid of TIF_MEMDIE


The diffstat looks quite promissing to me
 arch/alpha/include/asm/thread_info.h      |  1 -
 arch/arc/include/asm/thread_info.h        |  2 --
 arch/arm/include/asm/thread_info.h        |  1 -
 arch/arm64/include/asm/thread_info.h      |  1 -
 arch/avr32/include/asm/thread_info.h      |  2 --
 arch/blackfin/include/asm/thread_info.h   |  1 -
 arch/c6x/include/asm/thread_info.h        |  1 -
 arch/cris/include/asm/thread_info.h       |  1 -
 arch/frv/include/asm/thread_info.h        |  1 -
 arch/h8300/include/asm/thread_info.h      |  1 -
 arch/hexagon/include/asm/thread_info.h    |  1 -
 arch/ia64/include/asm/thread_info.h       |  1 -
 arch/m32r/include/asm/thread_info.h       |  1 -
 arch/m68k/include/asm/thread_info.h       |  1 -
 arch/metag/include/asm/thread_info.h      |  1 -
 arch/microblaze/include/asm/thread_info.h |  1 -
 arch/mips/include/asm/thread_info.h       |  1 -
 arch/mn10300/include/asm/thread_info.h    |  1 -
 arch/nios2/include/asm/thread_info.h      |  1 -
 arch/openrisc/include/asm/thread_info.h   |  1 -
 arch/parisc/include/asm/thread_info.h     |  1 -
 arch/powerpc/include/asm/thread_info.h    |  1 -
 arch/s390/include/asm/thread_info.h       |  1 -
 arch/score/include/asm/thread_info.h      |  1 -
 arch/sh/include/asm/thread_info.h         |  1 -
 arch/sparc/include/asm/thread_info_32.h   |  1 -
 arch/sparc/include/asm/thread_info_64.h   |  1 -
 arch/tile/include/asm/thread_info.h       |  2 --
 arch/um/include/asm/thread_info.h         |  2 --
 arch/unicore32/include/asm/thread_info.h  |  1 -
 arch/x86/include/asm/thread_info.h        |  1 -
 arch/xtensa/include/asm/thread_info.h     |  1 -
 include/linux/sched.h                     |  2 +-
 kernel/cpuset.c                           |  9 ++---
 kernel/exit.c                             | 38 +++++++++++++++------
 kernel/freezer.c                          |  3 +-
 mm/internal.h                             | 11 ++++++
 mm/memcontrol.c                           |  2 +-
 mm/oom_kill.c                             | 42 +++++++++++++----------
 mm/page_alloc.c                           | 57 +++++++++++++++++++++++++------
 40 files changed, 118 insertions(+), 82 deletions(-)

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2016-09-19 19:03 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-01  9:51 [RFC 0/4] mm, oom: get rid of TIF_MEMDIE Michal Hocko
2016-09-01  9:51 ` Michal Hocko
2016-09-01  9:51 ` [RFC 1/4] mm, oom: do not rely on TIF_MEMDIE for memory reserves access Michal Hocko
2016-09-01  9:51   ` Michal Hocko
2016-09-04  1:49   ` Tetsuo Handa
2016-09-04  1:49     ` Tetsuo Handa
2016-09-09 14:00     ` Michal Hocko
2016-09-09 14:00       ` Michal Hocko
2016-09-01  9:51 ` [RFC 2/4] mm: replace TIF_MEMDIE checks by tsk_is_oom_victim Michal Hocko
2016-09-01  9:51   ` Michal Hocko
2016-09-04  1:49   ` Tetsuo Handa
2016-09-04  1:49     ` Tetsuo Handa
2016-09-09 14:05     ` Michal Hocko
2016-09-09 14:05       ` Michal Hocko
2016-09-01  9:51 ` [RFC 3/4] mm, oom: do not rely on TIF_MEMDIE for exit_oom_victim Michal Hocko
2016-09-01  9:51   ` Michal Hocko
2016-09-04  1:50   ` Tetsuo Handa
2016-09-04  1:50     ` Tetsuo Handa
2016-09-09 14:08     ` Michal Hocko
2016-09-09 14:08       ` Michal Hocko
2016-09-10  6:29       ` Tetsuo Handa
2016-09-10  6:29         ` Tetsuo Handa
2016-09-10 12:55         ` Tetsuo Handa
2016-09-10 12:55           ` Tetsuo Handa
2016-09-12  9:11           ` Michal Hocko
2016-09-12  9:11             ` Michal Hocko
2016-09-13  6:25             ` Tetsuo Handa
2016-09-13  6:25               ` Tetsuo Handa
2016-09-13  7:21               ` Michal Hocko
2016-09-13  7:21                 ` Michal Hocko
2016-09-14 13:50   ` Michal Hocko
2016-09-14 13:50     ` Michal Hocko
2016-09-01  9:51 ` [RFC 4/4] arch: get rid of TIF_MEMDIE Michal Hocko
2016-09-01  9:51   ` Michal Hocko
2016-09-15 14:41 ` [RFC 0/4] mm, oom: " Johannes Weiner
2016-09-15 14:41   ` Johannes Weiner
2016-09-16  7:15   ` Michal Hocko
2016-09-16  7:15     ` Michal Hocko
2016-09-19 16:18     ` Johannes Weiner
2016-09-19 16:18       ` Johannes Weiner
2016-09-19 19:02       ` Michal Hocko
2016-09-19 19:02         ` Michal Hocko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.