All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,surenb@google.com,peterx@redhat.com,
	david@kernel.org,rppt@kernel.org,akpm@linux-foundation.org
Subject: + userfaultfd-mark-thps-moved-by-uffdio_move-soft-dirty.patch added to mm-new branch
Date: Thu, 03 Dec 2026 23:04:06 -0800	[thread overview]
Message-ID: <20261204070406.683991F000CE@smtp.kernel.org> (raw)
In-Reply-To: <20261203-fixes-uffd-sashiko-v2-3-308ce557a7b6@kernel.org>


The patch titled
     Subject: userfaultfd: mark THPs moved by UFFDIO_MOVE soft-dirty
has been added to the -mm mm-new branch.  Its filename is
     userfaultfd-mark-thps-moved-by-uffdio_move-soft-dirty.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/userfaultfd-mark-thps-moved-by-uffdio_move-soft-dirty.patch

This patch will later appear in the mm-new branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews.  Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.

The mm-new branch of mm.git is not included in linux-next

If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Subject: userfaultfd: mark THPs moved by UFFDIO_MOVE soft-dirty
Date: Thu, 03 Dec 2026 19:15:23 +0200

UFFDIO_MOVE marks moved PTEs and a moved huge zero page soft-dirty, like
mremap() does.

A THP is the exception. move_pages_huge_pmd() creates the destination PMD
from scratch and does not mark it soft-dirty, so soft-dirty trackers such
as CRIU miss the move.

Mark the moved THP PMD soft-dirty with move_soft_dirty_pmd(), like
mremap() does for PMDs.

Link: https://patch.msgid.link/20261203-fixes-uffd-sashiko-v2-3-308ce557a7b6@kernel.org
Fixes: adef440691ba ("userfaultfd: UFFDIO_MOVE uABI")
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: Suren Baghdasaryan <surenb@google.com>

 mm/huge_memory.c |    1 +
 1 file changed, 1 insertion(+)

--- a/mm/huge_memory.c~userfaultfd-mark-thps-moved-by-uffdio_move-soft-dirty
+++ a/mm/huge_memory.c
@@ -2983,6 +2983,7 @@ int move_pages_huge_pmd(struct mm_struct
 		_dst_pmd = folio_mk_pmd(src_folio, dst_vma->vm_page_prot);
 		/* Follow mremap() behavior and treat the entry dirty after the move */
 		_dst_pmd = pmd_mkwrite(pmd_mkdirty(_dst_pmd), dst_vma);
+		_dst_pmd = move_soft_dirty_pmd(_dst_pmd);
 	} else {
 		pmdp_huge_clear_flush(src_vma, src_addr, src_pmd);
 		_dst_pmd = folio_mk_pmd(huge_zero_folio, dst_vma->vm_page_prot);
_

Patches currently in -mm which might be from rppt@kernel.org are

mm-cma-simplify-cma_declare_contiguous_multi.patch
mm-fake-numa-fix-leak-of-the-distance-table-copy-on-errors.patch
mm-secretmem-disable-memfd_secret-if-secretmem_init-fails.patch
mm-cma-fix-handling-of-free-ranges-that-cross-4g-for-multi-range-areas.patch
userfaultfd-write-lock-the-vma-before-clearing-its-uffd-state.patch
userfaultfd-mark-zero-pages-moved-by-uffdio_move-soft-dirty.patch
userfaultfd-mark-thps-moved-by-uffdio_move-soft-dirty.patch
selftests-mm-free-the-test-context-when-uffd_test_ctx_init-fails.patch
hibernation-make-swsusp_page-helpers-static.patch
hibernation-ensure-secretmem-pages-dont-reach-a-snapshot.patch
hibernate-handle-potential-errors-in-hibernate_mapunmap_page.patch
hibernation-kfence-explicitly-map-unmap-kfence-pages.patch
hibernation-make-hibernation-unavailable-when-debug_pagealloc-is-on.patch


  reply	other threads:[~2026-12-04  7:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 17:15 [PATCH v2 0/4] userfaultfd: fixes for sashiko reports Mike Rapoport (Microsoft)
2026-12-03 17:15 ` [PATCH v2 1/4] userfaultfd: write-lock the VMA before clearing its uffd state Mike Rapoport (Microsoft)
2026-12-04  7:04   ` + userfaultfd-write-lock-the-vma-before-clearing-its-uffd-state.patch added to mm-new branch Andrew Morton
2026-12-04  9:27   ` [PATCH v2 1/4] userfaultfd: write-lock the VMA before clearing its uffd state Jose A. Perez de Azpillaga
2026-12-03 17:15 ` [PATCH v2 2/4] userfaultfd: mark zero pages moved by UFFDIO_MOVE soft-dirty Mike Rapoport (Microsoft)
2026-12-04  7:04   ` + userfaultfd-mark-zero-pages-moved-by-uffdio_move-soft-dirty.patch added to mm-new branch Andrew Morton
2026-12-04  9:31   ` [PATCH v2 2/4] userfaultfd: mark zero pages moved by UFFDIO_MOVE soft-dirty Jose A. Perez de Azpillaga
2026-12-03 17:15 ` [PATCH v2 3/4] userfaultfd: mark THPs " Mike Rapoport (Microsoft)
2026-12-04  7:04   ` Andrew Morton [this message]
2026-12-04  9:32   ` Jose A. Perez de Azpillaga
2026-12-03 17:15 ` [PATCH v2 4/4] selftests/mm: free the test context when uffd_test_ctx_init() fails Mike Rapoport (Microsoft)
2026-12-04  7:04   ` + selftests-mm-free-the-test-context-when-uffd_test_ctx_init-fails.patch added to mm-new branch Andrew Morton
2026-12-04  9:39   ` [PATCH v2 4/4] selftests/mm: free the test context when uffd_test_ctx_init() fails Jose A. Perez de Azpillaga
2026-12-05 17:09   ` Andrew Morton
2026-12-05 17:09   ` + selftests-mm-free-the-test-context-when-uffd_test_ctx_init-fails-fix.patch added to mm-new branch Andrew Morton

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=20261204070406.683991F000CE@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=peterx@redhat.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.