damon.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: kernel test robot <lkp@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	Oscar Salvador <osalvador@suse.de>, SeongJae Park <sj@kernel.org>
Cc: <oe-kbuild-all@lists.linux.dev>,
	Linux Memory Management List <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>, <damon@lists.linux.dev>,
	<vishal.moola@gmail.com>, <willy@infradead.org>
Subject: Re: [PATCH -next 1/8] mm: memory_hotplug: add pfn_to_online_folio()
Date: Tue, 13 Dec 2022 19:36:04 +0800	[thread overview]
Message-ID: <3312eb55-6ce5-67e3-389f-4937002423cd@huawei.com> (raw)
In-Reply-To: <202212131842.5xNHRahj-lkp@intel.com>


On 2022/12/13 19:13, kernel test robot wrote:
> Hi Kefeng,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on linus/master]
> [also build test ERROR on v6.1]
> [cannot apply to akpm-mm/mm-everything next-20221213]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Kefeng-Wang/mm-converted-page-idle-and-damon-to-use-folios/20221213-171230
> patch link:    https://lore.kernel.org/r/20221213092735.187924-2-wangkefeng.wang%40huawei.com
> patch subject: [PATCH -next 1/8] mm: memory_hotplug: add pfn_to_online_folio()
> config: alpha-allyesconfig
> compiler: alpha-linux-gcc (GCC) 12.1.0
> reproduce (this is a W=1 build):
>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          # https://github.com/intel-lab-lkp/linux/commit/6549c7ce5345695320d1dadef2aceff6e76d34f4
>          git remote add linux-review https://github.com/intel-lab-lkp/linux
>          git fetch --no-tags linux-review Kefeng-Wang/mm-converted-page-idle-and-damon-to-use-folios/20221213-171230
>          git checkout 6549c7ce5345695320d1dadef2aceff6e76d34f4
>          # save the config file
>          mkdir build_dir && cp config build_dir/.config
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=alpha prepare
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
>
> All error/warnings (new ones prefixed by >>):
>
>     In file included from include/linux/mmzone.h:1245,
>                      from include/linux/gfp.h:7,
>                      from include/linux/percpu_counter.h:16,
>                      from include/linux/sched/user.h:7,
>                      from include/linux/cred.h:17,
>                      from include/linux/sched/signal.h:10,
>                      from include/linux/ptrace.h:7,
>                      from arch/alpha/kernel/asm-offsets.c:11:
>     include/linux/memory_hotplug.h: In function 'pfn_to_online_folio':
>>> include/linux/memory_hotplug.h:230:13: error: implicit declaration of function 'pfn_valid'; did you mean 'gid_valid'? [-Werror=implicit-function-declaration]
>       230 |         if (pfn_valid(pfn))                     \
>           |             ^~~~~~~~~
>     include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page'
>       270 |         struct page *page = pfn_to_online_page(pfn);
>           |                             ^~~~~~~~~~~~~~~~~~
>     In file included from arch/alpha/include/asm/page.h:94,
>                      from include/linux/shm.h:6,
>                      from include/linux/sched.h:16,
>                      from arch/alpha/kernel/asm-offsets.c:10:
>>> include/asm-generic/memory_model.h:41:37: error: implicit declaration of function '__pfn_to_section' [-Werror=implicit-function-declaration]
>        41 |         struct mem_section *__sec = __pfn_to_section(__pfn);    \
>           |                                     ^~~~~~~~~~~~~~~~
>     include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page'
>        53 | #define pfn_to_page __pfn_to_page
>           |                     ^~~~~~~~~~~~~
>     include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page'
>       231 |                 ___page = pfn_to_page(pfn);     \
>           |                           ^~~~~~~~~~~
>     include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page'
>       270 |         struct page *page = pfn_to_online_page(pfn);
>           |                             ^~~~~~~~~~~~~~~~~~
>>> include/asm-generic/memory_model.h:41:37: warning: initialization of 'struct mem_section *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
>        41 |         struct mem_section *__sec = __pfn_to_section(__pfn);    \
>           |                                     ^~~~~~~~~~~~~~~~
>     include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page'
>        53 | #define pfn_to_page __pfn_to_page
>           |                     ^~~~~~~~~~~~~
>     include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page'
>       231 |                 ___page = pfn_to_page(pfn);     \
>           |                           ^~~~~~~~~~~
>     include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page'
>       270 |         struct page *page = pfn_to_online_page(pfn);
>           |                             ^~~~~~~~~~~~~~~~~~
>     include/asm-generic/memory_model.h:41:37: note: (near initialization for 'page')
>        41 |         struct mem_section *__sec = __pfn_to_section(__pfn);    \
>           |                                     ^~~~~~~~~~~~~~~~
>     include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page'
>        53 | #define pfn_to_page __pfn_to_page
>           |                     ^~~~~~~~~~~~~
>     include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page'
>       231 |                 ___page = pfn_to_page(pfn);     \
>           |                           ^~~~~~~~~~~
>     include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page'
>       270 |         struct page *page = pfn_to_online_page(pfn);
>           |                             ^~~~~~~~~~~~~~~~~~
>>> include/asm-generic/memory_model.h:42:9: error: implicit declaration of function '__section_mem_map_addr' [-Werror=implicit-function-declaration]
>        42 |         __section_mem_map_addr(__sec) + __pfn;          \
>           |         ^~~~~~~~~~~~~~~~~~~~~~
>     include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page'
>        53 | #define pfn_to_page __pfn_to_page
>           |                     ^~~~~~~~~~~~~
>     include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page'
>       231 |                 ___page = pfn_to_page(pfn);     \
>           |                           ^~~~~~~~~~~
>     include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page'
>       270 |         struct page *page = pfn_to_online_page(pfn);
>           |                             ^~~~~~~~~~~~~~~~~~
>>> include/linux/memory_hotplug.h:231:25: warning: assignment to 'struct page *' from 'long unsigned int' makes pointer from integer without a cast [-Wint-conversion]
>       231 |                 ___page = pfn_to_page(pfn);     \
>           |                         ^
>     include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page'
>       270 |         struct page *page = pfn_to_online_page(pfn);
>           |                             ^~~~~~~~~~~~~~~~~~
>     include/linux/mmzone.h: At top level:
>>> include/linux/mmzone.h:1740:28: error: conflicting types for '__section_mem_map_addr'; have 'struct page *(struct mem_section *)'
>      1740 | static inline struct page *__section_mem_map_addr(struct mem_section *section)
>           |                            ^~~~~~~~~~~~~~~~~~~~~~
>     include/asm-generic/memory_model.h:42:9: note: previous implicit declaration of '__section_mem_map_addr' with type 'int()'
>        42 |         __section_mem_map_addr(__sec) + __pfn;          \
>           |         ^~~~~~~~~~~~~~~~~~~~~~
>     include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page'
>        53 | #define pfn_to_page __pfn_to_page
>           |                     ^~~~~~~~~~~~~
>     include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page'
>       231 |                 ___page = pfn_to_page(pfn);     \
>           |                           ^~~~~~~~~~~
>     include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page'
>       270 |         struct page *page = pfn_to_online_page(pfn);
>           |                             ^~~~~~~~~~~~~~~~~~
>>> include/linux/mmzone.h:1801:35: error: conflicting types for '__pfn_to_section'; have 'struct mem_section *(long unsigned int)'
>      1801 | static inline struct mem_section *__pfn_to_section(unsigned long pfn)
>           |                                   ^~~~~~~~~~~~~~~~
>     include/asm-generic/memory_model.h:41:37: note: previous implicit declaration of '__pfn_to_section' with type 'int()'
>        41 |         struct mem_section *__sec = __pfn_to_section(__pfn);    \
>           |                                     ^~~~~~~~~~~~~~~~
>     include/asm-generic/memory_model.h:53:21: note: in expansion of macro '__pfn_to_page'
>        53 | #define pfn_to_page __pfn_to_page
>           |                     ^~~~~~~~~~~~~
>     include/linux/memory_hotplug.h:231:27: note: in expansion of macro 'pfn_to_page'
>       231 |                 ___page = pfn_to_page(pfn);     \
>           |                           ^~~~~~~~~~~
>     include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page'
>       270 |         struct page *page = pfn_to_online_page(pfn);
>           |                             ^~~~~~~~~~~~~~~~~~
>>> include/linux/mmzone.h:1839:19: error: static declaration of 'pfn_valid' follows non-static declaration
>      1839 | static inline int pfn_valid(unsigned long pfn)
>           |                   ^~~~~~~~~
>     include/linux/memory_hotplug.h:230:13: note: previous implicit declaration of 'pfn_valid' with type 'int()'
>       230 |         if (pfn_valid(pfn))                     \
>           |             ^~~~~~~~~
>     include/linux/memory_hotplug.h:270:29: note: in expansion of macro 'pfn_to_online_page'
>       270 |         struct page *page = pfn_to_online_page(pfn);
>           |                             ^~~~~~~~~~~~~~~~~~
>     arch/alpha/kernel/asm-offsets.c:15:6: warning: no previous prototype for 'foo' [-Wmissing-prototypes]
>        15 | void foo(void)
>           |      ^~~
>     cc1: some warnings being treated as errors
>     make[2]: *** [scripts/Makefile.build:118: arch/alpha/kernel/asm-offsets.s] Error 1
>     make[2]: Target 'prepare' not remade because of errors.
>     make[1]: *** [Makefile:1272: prepare0] Error 2
>     make[1]: Target 'prepare' not remade because of errors.
>     make: *** [Makefile:231: __sub-make] Error 2
>     make: Target 'prepare' not remade because of errors.
>
>
> vim +230 include/linux/memory_hotplug.h
Thanks, it seems that we need use macro definition instead of inline 
function, will update in the next version.
>
> b4a0215e11dcfe Kefeng Wang  2022-08-27  225
> 208d54e5513c0c Dave Hansen  2005-10-29  226  #else /* ! CONFIG_MEMORY_HOTPLUG */
> 2d070eab2e8270 Michal Hocko 2017-07-06  227  #define pfn_to_online_page(pfn)			\
> 2d070eab2e8270 Michal Hocko 2017-07-06  228  ({						\
> 2d070eab2e8270 Michal Hocko 2017-07-06  229  	struct page *___page = NULL;		\
> 2d070eab2e8270 Michal Hocko 2017-07-06 @230  	if (pfn_valid(pfn))			\
> 2d070eab2e8270 Michal Hocko 2017-07-06 @231  		___page = pfn_to_page(pfn);	\
> 2d070eab2e8270 Michal Hocko 2017-07-06  232  	___page;				\
> 2d070eab2e8270 Michal Hocko 2017-07-06  233   })
> 2d070eab2e8270 Michal Hocko 2017-07-06  234
>

  reply	other threads:[~2022-12-13 11:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13  9:27 [PATCH -next 0/8] mm: converted page idle and damon to use folios Kefeng Wang
2022-12-13  9:27 ` [PATCH -next 1/8] mm: memory_hotplug: add pfn_to_online_folio() Kefeng Wang
2022-12-13 11:13   ` kernel test robot
2022-12-13 11:36     ` Kefeng Wang [this message]
2022-12-13 11:23   ` kernel test robot
2022-12-13 11:40   ` David Hildenbrand
2022-12-13 12:13     ` Kefeng Wang
2022-12-13 14:42       ` David Hildenbrand
2022-12-13 14:47       ` Matthew Wilcox
2022-12-14  1:10         ` Kefeng Wang
2022-12-13 12:03   ` kernel test robot
2022-12-14  4:15   ` kernel test robot
2022-12-13  9:27 ` [PATCH -next 2/8] mm: page_idle: Convert page idle to use folios Kefeng Wang
2022-12-13 14:34   ` Matthew Wilcox
2022-12-13 19:14   ` SeongJae Park
2022-12-13  9:27 ` [PATCH -next 3/8] mm: huge_memory: convert split_huge_pages_all() " Kefeng Wang
2022-12-13  9:27 ` [PATCH -next 4/8] mm: damon: add temporary damon_get_folio() Kefeng Wang
2022-12-13 14:40   ` Matthew Wilcox
2022-12-13 19:18     ` SeongJae Park
2022-12-13  9:27 ` [PATCH -next 5/8] mm: damon: convert damon_ptep/pmdp_mkold() to use folios Kefeng Wang
2022-12-13  9:27 ` [PATCH -next 6/8] mm: damon: paddr: convert damon_pa_*() " Kefeng Wang
2022-12-13  9:27 ` [PATCH -next 7/8] mm: damon: vaddr: convert damon_young_pmd_entry() to use folio Kefeng Wang
2022-12-13  9:27 ` [PATCH -next 8/8] mm: damon: remove unneed damon_get_page() Kefeng Wang
2022-12-13 19:26   ` SeongJae Park

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=3312eb55-6ce5-67e3-389f-4937002423cd@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=osalvador@suse.de \
    --cc=sj@kernel.org \
    --cc=vishal.moola@gmail.com \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).