From: lizhe.67@bytedance.com
To: lkp@intel.com
Cc: akpm@linux-foundation.org, alex.williamson@redhat.com,
david@redhat.com, jgg@ziepe.ca, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
lizhe.67@bytedance.com, oe-kbuild-all@lists.linux.dev,
peterx@redhat.com
Subject: Re: [PATCH v2 1/5] mm: introduce num_pages_contiguous()
Date: Mon, 7 Jul 2025 11:52:59 +0800 [thread overview]
Message-ID: <20250707035259.61640-1-lizhe.67@bytedance.com> (raw)
In-Reply-To: <202507050529.EoMuEtd8-lkp@intel.com>
On Sat, 5 Jul 2025 05:19:34 +0800, lkp@intel.com wrote:
> All errors (new ones prefixed by >>):
>
> In file included from arch/sh/include/asm/page.h:160,
> from arch/sh/include/asm/thread_info.h:13,
> from include/linux/thread_info.h:60,
> from include/asm-generic/preempt.h:5,
> from ./arch/sh/include/generated/asm/preempt.h:1,
> from include/linux/preempt.h:79,
> from include/linux/spinlock.h:56,
> from include/linux/mmzone.h:8,
> from include/linux/gfp.h:7,
> from include/linux/mm.h:7,
> from arch/sh/kernel/asm-offsets.c:14:
> include/linux/mm.h: In function 'num_pages_contiguous':
> >> include/asm-generic/memory_model.h:48:21: error: implicit declaration of function 'page_to_section'; did you mean 'present_section'? [-Wimplicit-function-declaration]
> 48 | int __sec = page_to_section(__pg); \
> | ^~~~~~~~~~~~~~~
> include/asm-generic/memory_model.h:53:32: note: in definition of macro '__pfn_to_page'
> 53 | ({ unsigned long __pfn = (pfn); \
> | ^~~
> include/asm-generic/memory_model.h:65:21: note: in expansion of macro '__page_to_pfn'
> 65 | #define page_to_pfn __page_to_pfn
> | ^~~~~~~~~~~~~
> include/linux/mm.h:200:38: note: in expansion of macro 'page_to_pfn'
> 200 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
> | ^~~~~~~~~~~
> include/linux/mm.h:221:33: note: in expansion of macro 'nth_page'
> 221 | if (pages[i] != nth_page(first_page, i))
> | ^~~~~~~~
> include/linux/mm.h: At top level:
> >> include/linux/mm.h:2002:29: error: conflicting types for 'page_to_section'; have 'long unsigned int(const struct page *)'
> 2002 | static inline unsigned long page_to_section(const struct page *page)
> | ^~~~~~~~~~~~~~~
> include/asm-generic/memory_model.h:48:21: note: previous implicit declaration of 'page_to_section' with type 'int()'
> 48 | int __sec = page_to_section(__pg); \
> | ^~~~~~~~~~~~~~~
> include/asm-generic/memory_model.h:53:32: note: in definition of macro '__pfn_to_page'
> 53 | ({ unsigned long __pfn = (pfn); \
> | ^~~
> include/asm-generic/memory_model.h:65:21: note: in expansion of macro '__page_to_pfn'
> 65 | #define page_to_pfn __page_to_pfn
> | ^~~~~~~~~~~~~
> include/linux/mm.h:200:38: note: in expansion of macro 'page_to_pfn'
> 200 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
> | ^~~~~~~~~~~
> include/linux/mm.h:221:33: note: in expansion of macro 'nth_page'
> 221 | if (pages[i] != nth_page(first_page, i))
> | ^~~~~~~~
> make[3]: *** [scripts/Makefile.build:98: arch/sh/kernel/asm-offsets.s] Error 1
> make[3]: Target 'prepare' not remade because of errors.
> make[2]: *** [Makefile:1274: prepare0] Error 2
> make[2]: Target 'prepare' not remade because of errors.
> make[1]: *** [Makefile:248: __sub-make] Error 2
> make[1]: Target 'prepare' not remade because of errors.
> make: *** [Makefile:248: __sub-make] Error 2
> make: Target 'prepare' not remade because of errors.
>
>
> vim +2002 include/linux/mm.h
>
> bf4e8902ee5080 Daniel Kiper 2011-05-24 2001
> aa462abe8aaf21 Ian Campbell 2011-08-17 @2002 static inline unsigned long page_to_section(const struct page *page)
> d41dee369bff3b Andy Whitcroft 2005-06-23 2003 {
> d41dee369bff3b Andy Whitcroft 2005-06-23 2004 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
> d41dee369bff3b Andy Whitcroft 2005-06-23 2005 }
> 308c05e35e3517 Christoph Lameter 2008-04-28 2006 #endif
> d41dee369bff3b Andy Whitcroft 2005-06-23 2007
Thank you. Let's move function num_pages_contiguous() below the
definition of page_to_section() to resolve this compilation error.
Thanks,
Zhe
next prev parent reply other threads:[~2025-07-07 3:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-04 6:25 [PATCH v2 0/5] vfio/type1: optimize vfio_pin_pages_remote() and vfio_unpin_pages_remote() lizhe.67
2025-07-04 6:25 ` [PATCH v2 1/5] mm: introduce num_pages_contiguous() lizhe.67
2025-07-04 7:56 ` David Hildenbrand
2025-07-04 8:21 ` lizhe.67
2025-07-04 17:10 ` Jason Gunthorpe
2025-07-07 3:38 ` lizhe.67
2025-07-04 21:19 ` kernel test robot
2025-07-07 3:52 ` lizhe.67 [this message]
2025-07-04 6:25 ` [PATCH v2 2/5] vfio/type1: optimize vfio_pin_pages_remote() lizhe.67
2025-07-04 8:41 ` David Hildenbrand
2025-07-04 6:26 ` [PATCH v2 3/5] vfio/type1: batch vfio_find_vpfn() in function vfio_unpin_pages_remote() lizhe.67
2025-07-04 6:26 ` [PATCH v2 4/5] vfio/type1: introduce a new member has_rsvd for struct vfio_dma lizhe.67
2025-07-04 8:46 ` David Hildenbrand
2025-07-04 6:26 ` [PATCH v2 5/5] vfio/type1: optimize vfio_unpin_pages_remote() lizhe.67
2025-07-04 8:47 ` David Hildenbrand
2025-07-04 17:11 ` Jason Gunthorpe
2025-07-07 3:44 ` lizhe.67
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=20250707035259.61640-1-lizhe.67@bytedance.com \
--to=lizhe.67@bytedance.com \
--cc=akpm@linux-foundation.org \
--cc=alex.williamson@redhat.com \
--cc=david@redhat.com \
--cc=jgg@ziepe.ca \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=peterx@redhat.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