From: Muchun Song <muchun.song@linux.dev>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>,
Muchun Song <songmuchun@bytedance.com>,
Oscar Salvador <osalvador@suse.de>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Jonathan Corbet <corbet@lwn.net>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-doc@vger.kernel.org,
Lorenzo Stoakes <ljs@kernel.org>, Mike Rapoport <rppt@kernel.org>,
Qi Zheng <qi.zheng@linux.dev>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <chleroy@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [PATCH] fixup! mm/sparse-vmemmap: introduce CONFIG_VMEMMAP_OPTIMIZATION
Date: Wed, 16 Sep 2026 16:45:57 +0800 [thread overview]
Message-ID: <6A2BDF6D-96D2-4771-AB3F-7E702B01FFF2@linux.dev> (raw)
In-Reply-To: <20260916083627.2145779-1-songmuchun@bytedance.com>
> On Sep 16, 2026, at 16:36, Muchun Song <songmuchun@bytedance.com> wrote:
>
> The section-based vmemmap optimization infrastructure is guarded by
> CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP, but it can also be used by
> ZONE_DEVICE users that set dev_pagemap::vmemmap_shift. Introduce
> CONFIG_VMEMMAP_OPTIMIZATION as a common config for the shared
> infrastructure.
>
> Select the new option from HUGETLB_PAGE_OPTIMIZE_VMEMMAP and from
> ZONE_DEVICE when the architecture opts in to DAX vmemmap optimization,
> and use it to guard the generic sparse-vmemmap state and helpers.
>
> Signed-off-by: Muchun Song <songmuchun@bytedance.com>
> Acked-by: Qi Zheng <qi.zheng@linux.dev>
> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> Note: When folding this fix into
> "mm/sparse-vmemmap: introduce CONFIG_VMEMMAP_OPTIMIZATION",
> please use this commit message for the resulting patch.
Hi Andrew,
Sashiko found a configuration issue in patch 1 [1].
MSHV_VTL sets a non-zero dev_pagemap::vmemmap_shift for VTL0
memory. However, VMEMMAP_OPTIMIZATION is currently selected only by
DEV_DAX or HUGETLB_PAGE_OPTIMIZE_VMEMMAP.
With ZONE_DEVICE=y and MSHV_VTL=y, but DEV_DAX=n and
HUGETLB_PAGE=n, VMEMMAP_OPTIMIZATION is therefore disabled.
__vmemmap_can_optimize() always returns false in this configuration,
so VTL0 memory uses an unoptimized vmemmap despite its non-zero
vmemmap_shift. On common x86-64 configurations, this can consume up
to about 1.5% of the mapped VTL0 memory for vmemmap metadata.
The report is correct. The fixup in the parent message moves the
conditional selection of VMEMMAP_OPTIMIZATION from DEV_DAX to
ZONE_DEVICE. This covers every ZONE_DEVICE user that sets
dev_pagemap::vmemmap_shift while retaining the architecture opt-in
through ARCH_WANT_OPTIMIZE_DAX_VMEMMAP.
It also removes the DEV_DAX dependency on ZONE_DEVICE that patch 1
added solely to satisfy the Kconfig dependency of
VMEMMAP_OPTIMIZATION.
Andrew, could you please fold this fixup into patch 1,
"mm/sparse-vmemmap: introduce CONFIG_VMEMMAP_OPTIMIZATION"?
[1] https://sashiko.dev/#/patchset/20260916064341.1825793-1-songmuchun%40bytedance.com
Thanks,
Muchun
next prev parent reply other threads:[~2026-09-16 8:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 6:43 [PATCH v4 00/11] mm: Switch device DAX to section-based vmemmap optimization Muchun Song
2026-09-16 6:43 ` [PATCH v4 01/11] mm/sparse-vmemmap: introduce CONFIG_VMEMMAP_OPTIMIZATION Muchun Song
2026-09-16 8:36 ` [PATCH] fixup! " Muchun Song
2026-09-16 8:45 ` Muchun Song [this message]
2026-09-16 6:43 ` [PATCH v4 02/11] mm/sparse-vmemmap: factor out shared vmemmap tail page allocation Muchun Song
2026-09-16 6:43 ` [PATCH v4 03/11] mm/sparse-vmemmap: open-code init_compound_tail() Muchun Song
2026-09-16 6:43 ` [PATCH v4 04/11] mm/sparse-vmemmap: prepare DAX vmemmap population for compound page orders Muchun Song
2026-09-16 6:43 ` [PATCH v4 05/11] mm/sparse-vmemmap: set compound page order for device DAX Muchun Song
2026-09-16 6:43 ` [PATCH v4 06/11] mm/sparse-vmemmap: switch device DAX to shared tail vmemmap pages Muchun Song
2026-09-16 6:43 ` [PATCH v4 07/11] mm/sparse-vmemmap: move vmemmap optimization helpers to a public header Muchun Song
2026-09-16 6:43 ` [PATCH v4 08/11] powerpc/mm: switch device DAX to shared tail vmemmap pages Muchun Song
2026-09-16 6:43 ` [PATCH v4 09/11] mm/sparse-vmemmap: drop the extra tail page from device DAX reservation Muchun Song
2026-09-16 6:43 ` [PATCH v4 10/11] mm/sparse-vmemmap: drop unused section_nr_vmemmap_pages() arguments Muchun Song
2026-09-16 6:43 ` [PATCH v4 11/11] Documentation/mm: update DAX vmemmap deduplication docs Muchun Song
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=6A2BDF6D-96D2-4771-AB3F-7E702B01FFF2@linux.dev \
--to=muchun.song@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=chleroy@kernel.org \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=ljs@kernel.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=osalvador@suse.de \
--cc=qi.zheng@linux.dev \
--cc=rdunlap@infradead.org \
--cc=rppt@kernel.org \
--cc=songmuchun@bytedance.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®