From: Andrew Morton <akpm@linux-foundation.org>
To: "Konstantin Khorenko" <khorenko@virtuozzo.com>,
"David Hildenbrand (Arm)" <david@kernel.org>,
"Zi Yan" <ziy@nvidia.com>,
"Baolin Wang" <baolin.wang@linux.alibaba.com>,
"Liam R. Howlett" <liam@infradead.org>,
"Nico Pache" <nico.pache@linux.dev>,
"Ryan Roberts" <ryan.roberts@arm.com>,
"Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>,
"Lance Yang" <lance.yang@linux.dev>,
"Usama Arif" <usama.arif@linux.dev>,
"Kiryl Shutsemau" <kas@kernel.org>,
"Peter Xu" <peterx@redhat.com>,
"Alex Williamson" <alex@shazbot.org>,
kvm@vger.kernel.org,
"Loïc Molinari" <loic.molinari@collabora.com>,
"Lorenzo Stoakes" <ljs@kernel.org>,
"Shuah Khan" <shuah@kernel.org>,
linux-kselftest@vger.kernel.org, dri-devel@lists.freedesktop.org,
"Madhavan Srinivasan" <maddy@linux.ibm.com>,
"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, "Jason Gunthorpe" <jgg@ziepe.ca>,
stable@vger.kernel.org, Sashiko <sashiko-bot@kernel.org>
Subject: Re: [PATCH v5 0/4] mm/huge_memory: copy PMDs at fork like the PTE path does
Date: Fri, 6 Nov 2026 08:48:56 -0800 [thread overview]
Message-ID: <20261106084856.4b254c973694345ee58a9b63@linux-foundation.org> (raw)
In-Reply-To: <20261105211819.2a6a349b2edc077784ca52f9@linux-foundation.org>
On Thu, 5 Nov 2026 21:18:19 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> I'm attempting to runtime test this on local LLM-driven live kernel
> test setup, but it keeps on kicking me out and calling me a
> cybercriminal. Sigh. Giving up
Success.
tl;dr: all seems good. The expected performance gains and losses were
observed. Can't performance-test powerpc because the unpatched kernels
crashed due to the bug the series fixes.
: I tested the four v5 patches and the selftest fix on matched x86-64
: kernels. Both shmem fork tests passed with the series and skipped on
: the pre-series kernel, as expected. They checked inherited PMDs,
: private and shared writes, parent mappings and ShmemPmdMapped after
: child exit.
:
: The special-PMD race was reproduced with a virtual QXL device mapped
: through VFIO. Revocation before fork produced SIGBUS on both kernels.
: When revocation completed during a controlled pause in fork, the child
: accessed the revoked mapping before the series and received SIGBUS with
: the series. Both pauses were reached without timing out. No BUG,
: WARNING, KASAN report or oops appeared in these x86-64 runs.
:
: I also built matched PowerPC kernels and tested a POWER9/pseries
: hash-MMU guest under software emulation: two vCPUs, 2 GiB RAM, 64 KiB
: base pages and 16 MiB PMDs. A trace confirmed order-8 VFIO PMD
: insertion from a 64 MiB virtual PCI shared-memory BAR. On the
: pre-series kernel, the child's first access after fork caused a NULL
: pointer dereference in __hash_page_thp() and a soft lockup; that guest
: required a bounded timeout. With the series, the child read and exited
: normally. Revocation before fork gave the child SIGBUS with the series.
: This is one comparison, not a PowerPC stress test.
:
: I measured fork costs with a 512 MiB private shmem mapping, including
: 510 MiB actually mapped with PMDs. Median times from 100 forks per
: condition on each x86-64 kernel, following five warmups:
:
: Before With series
: fork only 49 us 63 us
: fork through child exit,
: no child reads 132 us 202 us
: fork through child exit,
: one read per PMD 637 us 326 us
:
: This workload pays more at fork and takes about half as long end-to-end
: when the child reads every PMD. These are single-boot measurements, not
: a broader performance characterization. The timing kernels had KASAN,
: lockdep and DEBUG_VM disabled; the correctness kernels had them enabled.
: The x86-64 KVM guests had 8 GiB, four vCPUs (one virtual socket, four
: single-threaded virtual cores) and one virtual NUMA node. The host has
: 64 physical cores and 128 SMT threads on one physical NUMA node;
: individual vCPUs were not pinned.
:
: I attempted a PowerPC VFIO fork-only timing comparison. The pre-series
: kernel faulted on the first child exit, even without a child read, and
: the guest was stopped after a 90-second timeout. The patched kernel
: completed 100 fork/exit operations, averaging 2.77 ms under software
: emulation with tracing enabled. There is no matched PowerPC performance
: comparison.
:
: Tested-by: Andrew Morton <akpm@linux-foundation.org>
next prev parent reply other threads:[~2026-11-06 16:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 20:40 Konstantin Khorenko
2026-11-04 20:40 ` [PATCH v5 1/4] mm/rmap: duplicate a PMD mapping as one in folio_dup_file_rmap_pmd() Konstantin Khorenko
2026-11-04 22:57 ` Jose A. Perez de Azpillaga
2026-11-04 20:40 ` [PATCH v5 2/4] mm/huge_memory: copy file THPs at fork like copy_present_ptes() does Konstantin Khorenko
2026-11-04 23:05 ` Jose A. Perez de Azpillaga
2026-11-06 3:04 ` Zi Yan
2026-11-04 20:40 ` [PATCH v5 3/4] mm/huge_memory: read a special PMD under the lock in copy_huge_pmd() Konstantin Khorenko
2026-11-04 23:09 ` Jose A. Perez de Azpillaga
2026-11-06 3:07 ` Zi Yan
2026-11-04 20:40 ` [PATCH v5 4/4] selftests/mm: test fork of PMD-mapped shmem THPs Konstantin Khorenko
2026-11-04 23:15 ` Jose A. Perez de Azpillaga
2026-11-05 13:15 ` Konstantin Khorenko
2026-11-06 5:18 ` [PATCH v5 0/4] mm/huge_memory: copy PMDs at fork like the PTE path does Andrew Morton
2026-11-06 16:48 ` Andrew Morton [this message]
2026-11-06 16:59 ` Konstantin Khorenko
2026-11-06 21:28 ` David Hildenbrand (Arm)
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=20261106084856.4b254c973694345ee58a9b63@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=alex@shazbot.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jgg@ziepe.ca \
--cc=kas@kernel.org \
--cc=khorenko@virtuozzo.com \
--cc=kvm@vger.kernel.org \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=ljs@kernel.org \
--cc=loic.molinari@collabora.com \
--cc=maddy@linux.ibm.com \
--cc=nico.pache@linux.dev \
--cc=peterx@redhat.com \
--cc=ritesh.list@gmail.com \
--cc=ryan.roberts@arm.com \
--cc=sashiko-bot@kernel.org \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
--cc=usama.arif@linux.dev \
--cc=ziy@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®