Linux s390 Architecture development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Muchun Song" <songmuchun@bytedance.com>,
	"David Hildenbrand" <david@kernel.org>,
	"Madhavan Srinivasan" <maddy@linux.ibm.com>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>
Cc: "Lance Yang" <lance.yang@linux.dev>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Christophe Leroy" <chleroy@kernel.org>,
	"Ritesh Harjani" <ritesh.list@gmail.com>,
	"Shrikanth Hegde" <sshegde@linux.ibm.com>,
	"Oscar Salvador" <osalvador@suse.de>,
	"Qi Zheng" <qi.zheng@linux.dev>,
	"Muchun Song" <muchun.song@linux.dev>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"WANG Xuerui" <kernel@xen0n.name>,
	linux-mm@kvack.org, x86@kernel.org, linux-s390@vger.kernel.org,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: Re: [PATCH v2 4/5] mm/sparse-vmemmap: drop vmemmap_can_optimize()
Date: Thu, 05 Nov 2026 07:16:50 +0000	[thread overview]
Message-ID: <sashiko-outbox-198654@kernel.org> (raw)
In-Reply-To: <20261105061217.13302-5-songmuchun@bytedance.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] mm/vmemmap: undeclared vmemmap in section_vmemmap_optimization_disable()
--

commit f0544b0eb7001e7264ebe693d049cf0cf0631ccd
Author: Muchun Song <muchun.song@linux.dev>

mm/sparse-vmemmap: drop vmemmap_can_optimize()

This commit removes the DAX-specific vmemmap_can_optimize() helper and relies
on section_vmemmap_optimizable() and section_vmemmap_optimization_disable()
to decide whether a section uses vmemmap optimization.

> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index a060a71504015..2fa5ce73b382a 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -38,7 +38,6 @@
>  #include <linux/bitops.h>
>  #include <linux/iommu-debug-pagealloc.h>
>  #include <linux/kcsan-checks.h>
> -#include <linux/vmemmap-optimization.h>

[Severity: Low]
Does this cause a build regression on LoongArch 64-bit configurations with
CONFIG_VMEMMAP_OPTIMIZATION enabled (such as loongson64_defconfig), or when
linux/vmemmap-optimization.h is included before asm/pgtable.h defines
vmemmap?

In arch/loongarch/include/asm/pgtable.h, asm/page.h (which pulls in
include/asm-generic/memory_model.h) is included first, defining:

    #define __page_to_pfn(page)	(unsigned long)((page) - vmemmap)

Later in arch/loongarch/include/asm/pgtable.h, linux/vmemmap-optimization.h
is included so MAX_FOLIO_VMEMMAP_ALIGN is available before defining vmemmap:

    #include <linux/mm_types.h>
    #include <linux/mmzone.h>
    #include <linux/vmemmap-optimization.h>
    ...
    #define VMEMMAP_ALIGN	max(PMD_SIZE, MAX_FOLIO_VMEMMAP_ALIGN)
    #define vmemmap		((struct page *)(ALIGN(VMALLOC_END, VMEMMAP_ALIGN)))

Because section_vmemmap_optimization_disable() in
include/linux/vmemmap-optimization.h is a static inline function that calls
page_to_pfn():

    static inline void section_vmemmap_optimization_disable(unsigned long start,
            unsigned long end)
    {
        unsigned long pfn = page_to_pfn((struct page *)start);

the preprocessor expands page_to_pfn() at the point where
linux/vmemmap-optimization.h is included, before the vmemmap macro is
defined, leaving an undeclared vmemmap identifier in the function body.

Additionally, removing the linux/vmemmap-optimization.h include from
include/linux/mm.h (where it was placed after linux/pgtable.h) means any
translation unit that includes linux/vmemmap-optimization.h before
asm/pgtable.h on architectures where vmemmap is defined in asm/pgtable.h will
hit the same undeclared vmemmap error.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261105061217.13302-1-songmuchun@bytedance.com?part=4

  reply	other threads:[~2026-11-05  7:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  6:12 [PATCH v2 0/5] mm: Simplify device DAX vmemmap optimization plumbing Muchun Song
2026-11-05  6:12 ` [PATCH v2 1/5] powerpc/mm: make vmemmap_populate_compound_pages() static Muchun Song
2026-11-05  7:16   ` sashiko-bot
2026-11-06  4:38   ` Lance Yang
2026-11-05  6:12 ` [PATCH v2 2/5] powerpc/mm: drop powerpc vmemmap_can_optimize() Muchun Song
2026-11-05  7:16   ` sashiko-bot
2026-11-05  8:02     ` Lance Yang
2026-11-06  6:09       ` Muchun Song
2026-11-06  9:48         ` Lance Yang
2026-11-05 12:13   ` kernel test robot
2026-11-05  6:12 ` [PATCH v2 3/5] loongarch/mm: disable device DAX vmemmap optimization Muchun Song
2026-11-05  7:16   ` sashiko-bot
2026-11-05  6:12 ` [PATCH v2 4/5] mm/sparse-vmemmap: drop vmemmap_can_optimize() Muchun Song
2026-11-05  7:16   ` sashiko-bot [this message]
2026-11-05  6:12 ` [PATCH v2 5/5] mm/sparse-vmemmap: drop @pgmap from vmemmap population APIs Muchun Song
2026-11-05  7:16   ` sashiko-bot

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=sashiko-outbox-198654@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=chenhuacai@kernel.org \
    --cc=chleroy@kernel.org \
    --cc=david@kernel.org \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=kernel@xen0n.name \
    --cc=lance.yang@linux.dev \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=muchun.song@linux.dev \
    --cc=npiggin@gmail.com \
    --cc=osalvador@suse.de \
    --cc=qi.zheng@linux.dev \
    --cc=ritesh.list@gmail.com \
    --cc=rppt@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=songmuchun@bytedance.com \
    --cc=sshegde@linux.ibm.com \
    --cc=x86@kernel.org \
    /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