linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/10] mm: Page fault enhancements
@ 2019-09-23  4:25 Peter Xu
  2019-09-23  4:25 ` [PATCH v4 01/10] mm/gup: Rename "nonblocking" to "locked" where proper Peter Xu
                   ` (9 more replies)
  0 siblings, 10 replies; 20+ messages in thread
From: Peter Xu @ 2019-09-23  4:25 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: David Hildenbrand, Hugh Dickins, Maya Gokhale, Jerome Glisse,
	Pavel Emelyanov, Johannes Weiner, peterx, Martin Cracauer,
	Marty McFadden, Shaohua Li, Andrea Arcangeli, Mike Kravetz,
	Denis Plotnikov, Mike Rapoport, Linus Torvalds, Mel Gorman,
	Kirill A . Shutemov, Dr . David Alan Gilbert

This is the 4th version of the PF enhancement series on signal
handlings and fault retries.  This new version does not change
existing patches in v3 but added two more patches to address the
current gup issue on not responding to SIGKILL.  A 3rd new patch is
also added to allow handle_userfaultfd to respect FAULT_FLAG_KILLABLE
though should have no functional change when with the two new patches
above.

I would really appreciate any review comments for the series,
especially for the first two patches which IMHO are even not related
to this patchset and they should either cleanup or fix things.

v4:
- use lore.kernel.org for all the links in commit messages [Kirill]
- one more patch ("mm/gup: Fix __get_user_pages() on fault retry of
  hugetlb") to fix hugetlb path on fault retry
- one more patch ("mm/gup: Allow to react to fatal signals") to:
  - use down_read_killable() properly [Linus]
  - pass in FAULT_FLAG_KILLABLE for all GUP [Linus]
- one more patch ("mm/userfaultfd: Honor FAULT_FLAG_KILLABLE in fault
  path") to let handle_userfaultfd() respect FAULT_FLAG_KILLABLE.
  Should have no functional change after previous two new patches.

v3:
- check fatal signals in __get_user_page_locked() [Linus]
- add r-bs

v2:
- resent previous version, rebase only

=============== v1 cover letter ==================

This series is split out of userfaultfd-wp series to only cover the
general page fault changes, since it seems to make sense itself.

Basically it does two things:

  (a) Allows the page fault handlers to be more interactive on not
      only SIGKILL, but also the rest of userspace signals (especially
      for user-mode faults), and,

  (b) Allows the page fault retry (VM_FAULT_RETRY) to happen for more
      than once.

I'm keeping the CC list as in uffd-wp v5, hopefully I'm not sending
too much spams...

And, instead of writting again the cover letter, I'm just copy-pasting
my previous link here which has more details on why we do this:

  https://patchwork.kernel.org/cover/10691991/

The major change from that latest version should be that we introduced
a new page fault flag FAULT_FLAG_INTERRUPTIBLE as suggested by Linus
[1] to represents that we would like the fault handler to respond to
non-fatal signals.  Also, we're more careful now on when to do the
immediate return of the page fault for such signals.  For example, now
we'll only check against signal_pending() for user-mode page faults
and we keep the kernel-mode page fault patch untouched for it.  More
information can be found in separate patches.

The patchset is only lightly tested on x86.

All comments are greatly welcomed.  Thanks,

[1] https://lkml.org/lkml/2019/6/25/1382

Peter Xu (10):
  mm/gup: Rename "nonblocking" to "locked" where proper
  mm/gup: Fix __get_user_pages() on fault retry of hugetlb
  mm: Introduce FAULT_FLAG_DEFAULT
  mm: Introduce FAULT_FLAG_INTERRUPTIBLE
  mm: Return faster for non-fatal signals in user mode faults
  userfaultfd: Don't retake mmap_sem to emulate NOPAGE
  mm: Allow VM_FAULT_RETRY for multiple times
  mm/gup: Allow VM_FAULT_RETRY for multiple times
  mm/gup: Allow to react to fatal signals
  mm/userfaultfd: Honor FAULT_FLAG_KILLABLE in fault path

 arch/alpha/mm/fault.c           |  7 +--
 arch/arc/mm/fault.c             |  8 ++-
 arch/arm/mm/fault.c             | 14 +++--
 arch/arm64/mm/fault.c           | 16 +++---
 arch/hexagon/mm/vm_fault.c      |  6 +--
 arch/ia64/mm/fault.c            |  6 +--
 arch/m68k/mm/fault.c            | 10 ++--
 arch/microblaze/mm/fault.c      |  6 +--
 arch/mips/mm/fault.c            |  6 +--
 arch/nds32/mm/fault.c           | 12 ++---
 arch/nios2/mm/fault.c           |  8 ++-
 arch/openrisc/mm/fault.c        |  6 +--
 arch/parisc/mm/fault.c          |  9 ++--
 arch/powerpc/mm/fault.c         | 10 ++--
 arch/riscv/mm/fault.c           | 12 ++---
 arch/s390/mm/fault.c            | 11 ++--
 arch/sh/mm/fault.c              |  7 ++-
 arch/sparc/mm/fault_32.c        |  5 +-
 arch/sparc/mm/fault_64.c        |  6 +--
 arch/um/kernel/trap.c           |  7 +--
 arch/unicore32/mm/fault.c       | 11 ++--
 arch/x86/mm/fault.c             |  6 +--
 arch/xtensa/mm/fault.c          |  6 +--
 drivers/gpu/drm/ttm/ttm_bo_vm.c | 12 +++--
 fs/userfaultfd.c                | 62 ++++++++++------------
 include/linux/mm.h              | 81 ++++++++++++++++++++++++----
 include/linux/sched/signal.h    | 12 +++++
 mm/filemap.c                    |  2 +-
 mm/gup.c                        | 93 +++++++++++++++++++++------------
 mm/hugetlb.c                    | 17 +++---
 mm/shmem.c                      |  2 +-
 31 files changed, 283 insertions(+), 193 deletions(-)

-- 
2.21.0



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

end of thread, other threads:[~2019-10-09  7:41 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-23  4:25 [PATCH v4 00/10] mm: Page fault enhancements Peter Xu
2019-09-23  4:25 ` [PATCH v4 01/10] mm/gup: Rename "nonblocking" to "locked" where proper Peter Xu
2019-09-23  4:25 ` [PATCH v4 02/10] mm/gup: Fix __get_user_pages() on fault retry of hugetlb Peter Xu
2019-09-23  4:25 ` [PATCH v4 03/10] mm: Introduce FAULT_FLAG_DEFAULT Peter Xu
2019-09-23  4:25 ` [PATCH v4 04/10] mm: Introduce FAULT_FLAG_INTERRUPTIBLE Peter Xu
2019-09-23  4:25 ` [PATCH v4 05/10] mm: Return faster for non-fatal signals in user mode faults Peter Xu
2019-09-23 18:03   ` Linus Torvalds
2019-09-24  2:47     ` Peter Xu
2019-09-24  2:54       ` Matthew Wilcox
2019-09-24  3:19         ` Peter Xu
2019-09-24 15:45           ` Matthew Wilcox
2019-09-25  3:46             ` Peter Xu
2019-09-26  8:58             ` Peter Xu
2019-10-08 22:43   ` Palmer Dabbelt
2019-10-09  7:41     ` Peter Xu
2019-09-23  4:25 ` [PATCH v4 06/10] userfaultfd: Don't retake mmap_sem to emulate NOPAGE Peter Xu
2019-09-23  4:25 ` [PATCH v4 07/10] mm: Allow VM_FAULT_RETRY for multiple times Peter Xu
2019-09-23  4:25 ` [PATCH v4 08/10] mm/gup: " Peter Xu
2019-09-23  4:25 ` [PATCH v4 09/10] mm/gup: Allow to react to fatal signals Peter Xu
2019-09-23  4:25 ` [PATCH v4 10/10] mm/userfaultfd: Honor FAULT_FLAG_KILLABLE in fault path Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).