All of lore.kernel.org
 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 5/5] mm/sparse-vmemmap: drop @pgmap from vmemmap population APIs
Date: Thu, 05 Nov 2026 07:16:52 +0000	[thread overview]
Message-ID: <sashiko-outbox-198655@kernel.org> (raw)
In-Reply-To: <20261105061217.13302-6-songmuchun@bytedance.com>

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

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

mm/sparse-vmemmap: drop @pgmap from vmemmap population APIs

This commit removes the @pgmap parameter from the vmemmap population
helpers and related memory hotplug interfaces, relying instead on
mem_section state and internal architecture-specific checks.

> diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
> index 71a927d67a9f9..5777f2e296845 100644
> --- a/mm/sparse-vmemmap.c
> +++ b/mm/sparse-vmemmap.c
> @@ -462,8 +462,7 @@ int __meminit vmemmap_populate_hugepages(unsigned long start, unsigned long end,
>  }
>  
>  struct page * __meminit __populate_section_memmap(unsigned long pfn,
> -		unsigned long nr_pages, int nid, struct vmem_altmap *altmap,
> -		struct dev_pagemap *pgmap)
> +		unsigned long nr_pages, int nid, struct vmem_altmap *altmap)
>  {
>  	unsigned long start = (unsigned long) pfn_to_page(pfn);
>  	unsigned long end = start + nr_pages * sizeof(struct page);

[Severity: Low]
Does section_vmemmap_optimization_disable() (called right below here in
__populate_section_memmap()) cause a build failure on 64-bit LoongArch
when CONFIG_VMEMMAP_OPTIMIZATION is enabled?

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

include/linux/vmemmap-optimization.h:
static inline void section_vmemmap_optimization_disable(unsigned long start,
		unsigned long end)
{
	unsigned long pfn = page_to_pfn((struct page *)start);

Under CONFIG_SPARSEMEM_VMEMMAP, page_to_pfn() expands via
include/asm-generic/memory_model.h to ((unsigned long)((page) - vmemmap)).
However, include/linux/vmemmap-optimization.h does not include
linux/pgtable.h or asm/pgtable.h where vmemmap is defined.

On 64-bit LoongArch, arch/loongarch/include/asm/pgtable.h includes
linux/vmemmap-optimization.h before defining the vmemmap macro:

arch/loongarch/include/asm/pgtable.h:
#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() is a static inline
function, the preprocessor expands page_to_pfn() inside
linux/vmemmap-optimization.h before vmemmap is defined, leaving vmemmap as
an undeclared identifier when compiling any translation unit that includes
asm/pgtable.h with CONFIG_VMEMMAP_OPTIMIZATION=y.

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


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

Thread overview: 24+ 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 ` Muchun Song
2026-11-05  6:12 ` [PATCH v2 1/5] powerpc/mm: make vmemmap_populate_compound_pages() static Muchun Song
2026-11-05  6:12   ` Muchun Song
2026-11-05  7:16   ` sashiko-bot
2026-11-06  4:38   ` Lance Yang
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  6:12   ` 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 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  6:12   ` 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  6:12   ` Muchun Song
2026-11-05  7:16   ` sashiko-bot
2026-11-05  6:12 ` [PATCH v2 5/5] mm/sparse-vmemmap: drop @pgmap from vmemmap population APIs Muchun Song
2026-11-05  6:12   ` Muchun Song
2026-11-05  7:16   ` sashiko-bot [this message]

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-198655@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 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.