linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: peterx@redhat.com, Jason Gunthorpe <jgg@ziepe.ca>,
	John Hubbard <jhubbard@nvidia.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Christoph Hellwig <hch@lst.de>, Yang Shi <shy828301@gmail.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Kirill Tkhai <ktkhai@virtuozzo.com>,
	Kirill Shutemov <kirill@shutemov.name>,
	Hugh Dickins <hughd@google.com>, Jann Horn <jannh@google.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Michal Hocko <mhocko@suse.com>, Jan Kara <jack@suse.cz>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Leon Romanovsky <leonro@nvidia.com>
Subject: [PATCH v2 0/4] mm: Break COW for pinned pages during fork()
Date: Fri, 25 Sep 2020 18:25:56 -0400	[thread overview]
Message-ID: <20200925222600.6832-1-peterx@redhat.com> (raw)

Due to the rebase to latest rc6, the major pte copy patch changed a lot.  So\r
maybe not that useful to write a changelog any more.  However all the comments\r
should be addressed as long as discussed in previous thread.  Please shoot if I\r
missed anything important.\r
\r
This series is majorly inspired by the previous discussion on the list [1],\r
starting from the report from Jason on the rdma test failure.  Linus proposed\r
the solution, which seems to be a very nice approach to avoid the breakage of\r
userspace apps that didn't use MADV_DONTFORK properly before.  More information\r
can be found in that thread too.\r
\r
I tested it myself with fork() after vfio pinning a bunch of device pages, and\r
I verified that the new copy pte logic worked as expected at least in the most\r
general path.  However I didn't test thp case yet because afaict vfio does not\r
support thp backed dma pages.  Luckily, the pmd/pud thp patch is much more\r
straightforward than the pte one, so hopefully it can be directly verified by\r
some code review plus some more heavy-weight rdma tests.\r
\r
Patch 1:      Introduce mm.has_pinned\r
Patch 2:      Preparation patch\r
Patch 3:      Early cow solution for pte copy for pinned pages\r
Patch 4:      Same as above, but for thp (pmd/pud).\r
\r
Hugetlbfs fix is still missing, but as planned, that's not urgent so we can\r
work upon.  Comments greatly welcomed.\r
\r
[1] https://lore.kernel.org/lkml/20200914143829.GA1424636@nvidia.com/\r
\r
Thanks.\r
\r
Peter Xu (4):\r
  mm: Introduce mm_struct.has_pinned\r
  mm/fork: Pass new vma pointer into copy_page_range()\r
  mm: Do early cow for pinned pages during fork() for ptes\r
  mm/thp: Split huge pmds/puds if they're pinned when fork()\r
\r
 include/linux/mm.h       |   2 +-\r
 include/linux/mm_types.h |  10 +++\r
 kernel/fork.c            |   3 +-\r
 mm/gup.c                 |   6 ++\r
 mm/huge_memory.c         |  28 ++++++\r
 mm/memory.c              | 186 ++++++++++++++++++++++++++++++++++-----\r
 6 files changed, 212 insertions(+), 23 deletions(-)\r
\r
-- \r
2.26.2\r
\r


             reply	other threads:[~2020-09-25 22:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 22:25 Peter Xu [this message]
2020-09-25 22:25 ` [PATCH v2 1/4] mm: Introduce mm_struct.has_pinned Peter Xu
2020-09-25 22:25 ` [PATCH v2 2/4] mm/fork: Pass new vma pointer into copy_page_range() Peter Xu
2020-09-30 13:30   ` Kirill A. Shutemov
2020-09-30 17:05     ` Peter Xu
2020-09-25 22:25 ` [PATCH v2 3/4] mm: Do early cow for pinned pages during fork() for ptes Peter Xu
2020-09-26 23:23   ` Jason Gunthorpe
2020-09-27  0:04     ` Linus Torvalds
2020-09-25 22:26 ` [PATCH v2 4/4] mm/thp: Split huge pmds/puds if they're pinned when fork() Peter Xu
2020-09-27 19:35 ` [PATCH v2 0/4] mm: Break COW for pinned pages during fork() Linus Torvalds
2020-09-29 11:02   ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200925222600.6832-1-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=jannh@google.com \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=kirill@shutemov.name \
    --cc=ktkhai@virtuozzo.com \
    --cc=leonro@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=oleg@redhat.com \
    --cc=shy828301@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [PATCH v2 0/4] mm: Break COW for pinned pages during fork()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).