All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/18] change mmap_sem taken for write killable
@ 2016-02-29 13:26 ` Michal Hocko
  0 siblings, 0 replies; 234+ messages in thread
From: Michal Hocko @ 2016-02-29 13:26 UTC (permalink / raw)
  To: LKML
  Cc: Andrew Morton, linux-mm, Alex Deucher, Alex Thorlton,
	Andrea Arcangeli, Andy Lutomirski, Benjamin LaHaise,
	Christian König, Daniel Vetter, Dave Hansen, David Airlie,
	Davidlohr Bueso, David Rientjes, H . Peter Anvin, Hugh Dickins,
	Ingo Molnar, Johannes Weiner, Kirill A . Shutemov,
	Konstantin Khlebnikov, linux-arch, Mel Gorman, Oleg Nesterov,
	Peter Zijlstra, Petr Cermak, Thomas Gleixner

Hi,
this is a follow up work for oom_reaper [1]. As the async OOM killing
depends on oom_sem for read we would really appreciate if a holder for
write stood in the way. This patchset is changing many of down_write
calls to be killable to help those cases when the writer is blocked and
waiting for readers to release the lock and so help __oom_reap_task to
process the oom victim.

Most of the patches are really trivial because the lock is help from a
shallow syscall paths where we can return EINTR trivially. Others seem
to be easy as well as the callers are already handling fatal errors and
bail and return to userspace which should be sufficient to handle the
failure gracefully. I am not familiar with all those code paths so a
deeper review is really appreciated.

As this work is touching more areas which are not directly connected I
have tried to keep the CC list as small as possible and people who I
believed would be familiar are CCed only to the specific patches (all
should have received the cover though).

This patchset is based on linux-next and it depends on down_write_killable
for rw_semaphores posted recently [2].

I haven't covered all the mmap_write(mm->mmap_sem) instances here

$ git grep "down_write(.*\<mmap_sem\>)" next/master | wc -l
102
$ git grep "down_write(.*\<mmap_sem\>)" | wc -l
66

I have tried to cover those which should be relatively easy to review in
this series because this alone should be a nice improvement. Other places
can be changed on top.

Any feedback is highly appreciated.

---
[1] http://lkml.kernel.org/r/1452094975-551-1-git-send-email-mhocko@kernel.org
[2] http://lkml.kernel.org/r/1456750705-7141-1-git-send-email-mhocko@kernel.org

^ permalink raw reply	[flat|nested] 234+ messages in thread
* [PATCH 0/18] change mmap_sem taken for write killable v2
@ 2016-04-26 12:56 Michal Hocko
  2016-04-26 12:56   ` Michal Hocko
  0 siblings, 1 reply; 234+ messages in thread
From: Michal Hocko @ 2016-04-26 12:56 UTC (permalink / raw)
  To: linux-mm, Andrew Morton
  Cc: LKML, Alexander Viro, Alex Deucher, Alex Thorlton,
	Andrea Arcangeli, Andy Lutomirski, Benamin LaHaise,
	Christian König, Daniel Vetter, Dave Hansen, David Airlie,
	Davidlohr Bueso, David Rientjes, H. Peter Anvin, Hugh Dickins,
	Ingo Molnar, Ingo Molnar, Jeff Moyer, Johannes Weiner,
	Kirill A. Shutemov, Konstantin Khlebnikov, Mel Gorman,
	Michal Hocko, Oleg Nesterov, Peter Zijlstra, Petr Cermak,
	Thomas Gleixner, Vlastimil Babka

Hi,
The previous version of the series was posted here [0]. There were
no large changes since then. I have rebased the series on top of the
current linux-next (next-20160426) and added few clarifications based on
the review feedback and acks/reviewed-by.

This is a follow up work for oom_reaper [1]. As the async OOM killing
depends on oom_sem for read we would really appreciate if a holder
for write didn't stood in the way. This patchset is changing many of
down_write calls to be killable to help those cases when the writer
is blocked and waiting for readers to release the lock and so help
__oom_reap_task to process the oom victim.

Most of the patches are really trivial because the lock is help from a
shallow syscall paths where we can return EINTR trivially and allow the
current task to die (note that EINTR will never get to the userspace as
the task has fatal signal pending). Others seem to be easy as well as
the callers are already handling fatal errors and bail and return to
userspace which should be sufficient to handle the failure gracefully. I
am not familiar with all those code paths so a deeper review is really
appreciated.

As this work is touching more areas which are not directly connected I
have tried to keep the CC list as small as possible and people who I
believed would be familiar are CCed only to the specific patches (all
should have received the cover though).

This patchset is based on linux-next and it depends on
down_write_killable for rw_semaphores which got merged into tip
locking/rwsem branch and it is merged into this next tree.  I guess
it would be easiest to route these patches via mmotm because of the
dependency on the tip tree but if respective maintainers prefer other
way I have no objections.

I haven't covered all the mmap_write(mm->mmap_sem) instances here

$ git grep "down_write(.*\<mmap_sem\>)" next/master | wc -l
98
$ git grep "down_write(.*\<mmap_sem\>)" | wc -l
62

I have tried to cover those which should be relatively easy to review in
this series because this alone should be a nice improvement. Other places
can be changed on top.

Any feedback is highly appreciated.

---
[0] http://lkml.kernel.org/r/1456752417-9626-1-git-send-email-mhocko@kernel.org
[1] http://lkml.kernel.org/r/1452094975-551-1-git-send-email-mhocko@kernel.org
[2] http://lkml.kernel.org/r/1456750705-7141-1-git-send-email-mhocko@kernel.org

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

end of thread, other threads:[~2016-04-26 12:56 UTC | newest]

Thread overview: 234+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-29 13:26 [PATCH 0/18] change mmap_sem taken for write killable Michal Hocko
2016-02-29 13:26 ` Michal Hocko
2016-02-29 13:26 ` Michal Hocko
2016-02-29 13:26 ` [PATCH 01/18] mm: Make mmap_sem for write waits killable for mm syscalls Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:44   ` kbuild test robot
2016-02-29 13:44     ` kbuild test robot
2016-02-29 13:44   ` kbuild test robot
2016-02-29 13:44     ` kbuild test robot
2016-03-10 15:47   ` Vlastimil Babka
2016-03-10 15:47     ` Vlastimil Babka
2016-03-10 15:47     ` Vlastimil Babka
2016-03-10 15:56     ` Michal Hocko
2016-03-10 15:56       ` Michal Hocko
2016-03-10 15:56       ` Michal Hocko
2016-02-29 13:26 ` [PATCH 02/18] mm: make vm_mmap killable Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-03-11  9:59   ` Vlastimil Babka
2016-03-11  9:59     ` Vlastimil Babka
2016-03-11  9:59     ` Vlastimil Babka
2016-03-11 12:12     ` Michal Hocko
2016-03-11 12:12       ` Michal Hocko
2016-03-11 12:12       ` Michal Hocko
2016-03-11 12:43       ` Vlastimil Babka
2016-03-11 12:43         ` Vlastimil Babka
2016-03-11 12:43         ` Vlastimil Babka
2016-03-11 12:55         ` Michal Hocko
2016-03-11 12:55           ` Michal Hocko
2016-03-11 12:55           ` Michal Hocko
2016-02-29 13:26 ` [PATCH 03/18] mm: make vm_munmap killable Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-03-11 10:06   ` Vlastimil Babka
2016-03-11 10:06     ` Vlastimil Babka
2016-03-11 10:06     ` Vlastimil Babka
2016-03-11 12:32     ` Michal Hocko
2016-03-11 12:32       ` Michal Hocko
2016-03-11 12:32       ` Michal Hocko
2016-02-29 13:26 ` [PATCH 04/18] mm, aout: handle vm_brk failures Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-03-11 10:32   ` Vlastimil Babka
2016-03-11 10:32     ` Vlastimil Babka
2016-03-11 10:32     ` Vlastimil Babka
2016-03-11 12:42     ` Michal Hocko
2016-03-11 12:42       ` Michal Hocko
2016-03-11 12:42       ` Michal Hocko
2016-02-29 13:26 ` [PATCH 05/18] mm, elf: handle vm_brk error Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-03-11 10:35   ` Vlastimil Babka
2016-03-11 10:35     ` Vlastimil Babka
2016-03-11 10:35     ` Vlastimil Babka
2016-02-29 13:26 ` [PATCH 06/18] mm: make vm_brk killable Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-03-11 10:44   ` Vlastimil Babka
2016-03-11 10:44     ` Vlastimil Babka
2016-03-11 10:44     ` Vlastimil Babka
2016-02-29 13:26 ` [PATCH 07/18] mm, proc: make clear_refs killable Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:47   ` kbuild test robot
2016-02-29 13:47     ` kbuild test robot
2016-02-29 17:38   ` Oleg Nesterov
2016-02-29 17:38     ` Oleg Nesterov
2016-02-29 17:38     ` Oleg Nesterov
2016-02-29 17:53     ` Michal Hocko
2016-02-29 17:53       ` Michal Hocko
2016-02-29 17:53       ` Michal Hocko
2016-02-29 17:58       ` Oleg Nesterov
2016-02-29 17:58         ` Oleg Nesterov
2016-02-29 17:58         ` Oleg Nesterov
2016-02-29 18:02         ` Michal Hocko
2016-02-29 18:02           ` Michal Hocko
2016-02-29 18:02           ` Michal Hocko
2016-02-29 17:56   ` [PATCH] " Michal Hocko
2016-02-29 17:56     ` Michal Hocko
2016-02-29 18:16     ` Oleg Nesterov
2016-02-29 18:16       ` Oleg Nesterov
2016-02-29 20:25     ` kbuild test robot
2016-03-11 10:59     ` Vlastimil Babka
2016-03-11 10:59       ` Vlastimil Babka
2016-02-29 13:26 ` [PATCH 08/18] mm, fork: make dup_mmap wait for mmap_sem for write killable Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:48   ` kbuild test robot
2016-02-29 13:48     ` kbuild test robot
2016-02-29 17:54   ` Oleg Nesterov
2016-02-29 17:54     ` Oleg Nesterov
2016-02-29 17:54     ` Oleg Nesterov
2016-02-29 18:07   ` [PATCH] " Michal Hocko
2016-02-29 18:07     ` Michal Hocko
2016-02-29 20:13     ` kbuild test robot
2016-03-11 11:12     ` Vlastimil Babka
2016-03-11 11:12       ` Vlastimil Babka
2016-02-29 13:26 ` [PATCH 09/18] ipc, shm: make shmem attach/detach wait for mmap_sem killable Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-03-08 19:15   ` Davidlohr Bueso
2016-03-08 19:15     ` Davidlohr Bueso
2016-03-08 19:15     ` Davidlohr Bueso
2016-03-09 10:16     ` Michal Hocko
2016-03-09 10:16       ` Michal Hocko
2016-03-09 10:16       ` Michal Hocko
2016-03-09 10:19   ` [PATCH] " Michal Hocko
2016-03-09 10:19     ` Michal Hocko
2016-03-09 10:46     ` kbuild test robot
2016-03-11 11:18     ` Vlastimil Babka
2016-03-11 11:18       ` Vlastimil Babka
2016-02-29 13:26 ` [PATCH 10/18] vdso: make arch_setup_additional_pages wait for mmap_sem for write killable Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:45   ` kbuild test robot
2016-02-29 13:45     ` kbuild test robot
2016-02-29 13:50   ` kbuild test robot
2016-02-29 13:50     ` kbuild test robot
2016-02-29 13:53   ` kbuild test robot
2016-02-29 13:53     ` kbuild test robot
2016-02-29 15:41   ` Andy Lutomirski
2016-02-29 15:41     ` Andy Lutomirski
2016-02-29 15:41     ` Andy Lutomirski
2016-03-11 11:28   ` Vlastimil Babka
2016-03-11 11:28     ` Vlastimil Babka
2016-03-11 11:28     ` Vlastimil Babka
2016-02-29 13:26 ` [PATCH 11/18] coredump: make coredump_wait wait for mma_sem " Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 15:57   ` Oleg Nesterov
2016-02-29 15:57     ` Oleg Nesterov
2016-02-29 15:57     ` Oleg Nesterov
2016-03-11 11:32   ` Vlastimil Babka
2016-03-11 11:32     ` Vlastimil Babka
2016-03-11 11:32     ` Vlastimil Babka
2016-03-11 11:54     ` Vlastimil Babka
2016-03-11 11:54       ` Vlastimil Babka
2016-03-11 11:54       ` Vlastimil Babka
2016-03-11 12:46       ` Michal Hocko
2016-03-11 12:46         ` Michal Hocko
2016-03-11 12:46         ` Michal Hocko
2016-02-29 13:26 ` [PATCH 12/18] aio: make aio_setup_ring killable Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 16:17   ` Jeff Moyer
2016-02-29 16:17     ` Jeff Moyer
2016-02-29 16:17     ` Jeff Moyer
2016-03-11 11:57   ` Vlastimil Babka
2016-03-11 11:57     ` Vlastimil Babka
2016-03-11 11:57     ` Vlastimil Babka
2016-02-29 13:26 ` [PATCH 13/18] exec: make exec path waiting for mmap_sem killable Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 17:23   ` Oleg Nesterov
2016-02-29 17:23     ` Oleg Nesterov
2016-02-29 17:23     ` Oleg Nesterov
2016-02-29 17:47     ` Michal Hocko
2016-02-29 17:47       ` Michal Hocko
2016-02-29 17:47       ` Michal Hocko
2016-02-29 18:10       ` Oleg Nesterov
2016-02-29 18:10         ` Oleg Nesterov
2016-02-29 18:10         ` Oleg Nesterov
2016-03-11 12:51   ` Vlastimil Babka
2016-03-11 12:51     ` Vlastimil Babka
2016-03-11 12:51     ` Vlastimil Babka
2016-02-29 13:26 ` [PATCH 14/18] prctl: make PR_SET_THP_DISABLE wait " Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-03-11 12:54   ` Vlastimil Babka
2016-03-11 12:54     ` Vlastimil Babka
2016-03-11 12:54     ` Vlastimil Babka
2016-02-29 13:26 ` [PATCH 15/18] uprobes: wait for mmap_sem for write killable Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 15:57   ` Oleg Nesterov
2016-02-29 15:57     ` Oleg Nesterov
2016-02-29 15:57     ` Oleg Nesterov
2016-02-29 16:28     ` Michal Hocko
2016-02-29 16:28       ` Michal Hocko
2016-02-29 16:28       ` Michal Hocko
2016-02-29 17:12       ` Oleg Nesterov
2016-02-29 17:12         ` Oleg Nesterov
2016-02-29 17:12         ` Oleg Nesterov
2016-02-29 17:42   ` [PATCH] " Michal Hocko
2016-02-29 17:42     ` Michal Hocko
2016-02-29 17:52     ` kbuild test robot
2016-02-29 17:53     ` kbuild test robot
2016-02-29 18:11     ` Oleg Nesterov
2016-02-29 18:11       ` Oleg Nesterov
2016-02-29 18:22       ` Michal Hocko
2016-02-29 18:22         ` Michal Hocko
2016-02-29 18:38         ` Oleg Nesterov
2016-02-29 18:38           ` Oleg Nesterov
2016-03-11 14:58     ` Vlastimil Babka
2016-03-11 14:58       ` Vlastimil Babka
2016-03-11 15:32       ` Michal Hocko
2016-03-11 15:32         ` Michal Hocko
2016-02-29 13:26 ` [PATCH 16/18] drm/i915: make i915_gem_mmap_ioctl wait for mmap_sem killable Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-03-11 15:23   ` Vlastimil Babka
2016-03-11 15:23     ` Vlastimil Babka
2016-03-11 15:23     ` Vlastimil Babka
2016-02-29 13:26 ` [PATCH 17/18] drm/radeon: make radeon_mn_get " Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:35   ` Christian König
2016-02-29 13:35     ` Christian König
2016-02-29 13:35     ` Christian König
2016-02-29 13:35     ` Christian König
2016-03-11 15:27   ` Vlastimil Babka
2016-03-11 15:27     ` Vlastimil Babka
2016-03-11 15:27     ` Vlastimil Babka
2016-02-29 13:26 ` [PATCH 18/18] drm/amdgpu: make amdgpu_mn_get " Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-02-29 13:26   ` Michal Hocko
2016-03-11 15:29   ` Vlastimil Babka
2016-03-11 15:29     ` Vlastimil Babka
2016-03-11 15:29     ` Vlastimil Babka
2016-02-29 13:31 ` [PATCH 0/18] change mmap_sem taken for write killable Michal Hocko
2016-02-29 13:31   ` Michal Hocko
2016-02-29 13:31   ` Michal Hocko
2016-02-29 14:04 ` Kirill A. Shutemov
2016-02-29 14:04   ` Kirill A. Shutemov
2016-02-29 14:04   ` Kirill A. Shutemov
2016-02-29 14:16   ` Michal Hocko
2016-02-29 14:16     ` Michal Hocko
2016-02-29 14:16     ` Michal Hocko
2016-02-29 15:03     ` Kirill A. Shutemov
2016-02-29 15:03       ` Kirill A. Shutemov
2016-02-29 15:03       ` Kirill A. Shutemov
2016-04-26 12:56 [PATCH 0/18] change mmap_sem taken for write killable v2 Michal Hocko
2016-04-26 12:56 ` [PATCH 02/18] mm: make vm_mmap killable Michal Hocko
2016-04-26 12:56   ` 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.