Re: [PATCH v3 3/3] mm/hwpoison: fix unpoison_memory()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Nov 07, 2021 at 07:25:13AM +0800, kernel test robot wrote:
> Hi Naoya,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on hnaz-mm/master]
> 
> url:    https://github.com/0day-ci/linux/commits/Naoya-Horiguchi/mm-hwpoison-fix-unpoison_memory/20211105-135311
> base:   https://github.com/hnaz/linux-mm master
> config: i386-allyesconfig (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce (this is a W=1 build):
>         # https://github.com/0day-ci/linux/commit/1b78bd027ee061f9378cf47687f9f4649a160fa4
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Naoya-Horiguchi/mm-hwpoison-fix-unpoison_memory/20211105-135311
>         git checkout 1b78bd027ee061f9378cf47687f9f4649a160fa4
>         # save the attached .config to linux build tree
>         make W=1 ARCH=i386 

I can't reproduce the same error with the above procedure (maybe because I
use newer version of gcc?), but anyway I suspect that memory-failure.c
should be compiled for i386 (which should not support software-recoverable
memory error).

X86_SUPPORTS_MEMORY_FAILURE depends on (X86_64 || !SPARSEMEM) in arch/x86/Kconfig,
where according to commit d949f36f1865 ("x86: Fix hwpoison code related build
failure on 32-bit NUMAQ"), dependency on !SPRASEMEM is just to avoid exhaustion of
page flag field. So I'm thinking of fixing this error by removing the dependency
on !SPARSEMEM like below.


diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index bc9503674249..9a047cb71bba 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -717,11 +717,10 @@ config X86_32_NON_STANDARD
 config X86_SUPPORTS_MEMORY_FAILURE
        def_bool y
        # MCE code calls memory_failure():
        depends on X86_MCE
-       # On 32-bit this adds too big of NODES_SHIFT and we run out of page flags:
-       # On 32-bit SPARSEMEM adds too big of SECTIONS_WIDTH:
-       depends on X86_64 || !SPARSEMEM
+       # On 32-bit software recoverable memory error is not supported:
+       depends on X86_64
        select ARCH_SUPPORTS_MEMORY_FAILURE

 config STA2X11
        bool "STA2X11 Companion Chip Support"


> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>

I'll add the tag. Thank you for the report.

- Naoya Horiguchi

> 
> All errors (new ones prefixed by >>):
> 
>    In file included from include/linux/mmzone.h:22,
>                     from include/linux/gfp.h:6,
>                     from include/linux/mm.h:10,
>                     from mm/memory-failure.c:37:
>    mm/memory-failure.c: In function 'SetPageHWPoisonTakenOff':
> >> include/linux/page-flags.h:525:24: error: unsigned conversion from 'long long int' to 'long unsigned int' changes value from '5212723395167473486' to '1230196558' [-Werror=overflow]
>      525 | #define MAGIC_HWPOISON 0x4857504f49534f4e
>          |                        ^~~~~~~~~~~~~~~~~~
>    mm/memory-failure.c:1170:25: note: in expansion of macro 'MAGIC_HWPOISON'
>     1170 |  set_page_private(page, MAGIC_HWPOISON);
>          |                         ^~~~~~~~~~~~~~
>    cc1: all warnings being treated as errors
> 
> 
> vim +525 include/linux/page-flags.h
> 
>    520	
>    521	#ifdef CONFIG_MEMORY_FAILURE
>    522	PAGEFLAG(HWPoison, hwpoison, PF_ANY)
>    523	TESTSCFLAG(HWPoison, hwpoison, PF_ANY)
>    524	#define __PG_HWPOISON (1UL << PG_hwpoison)
>  > 525	#define MAGIC_HWPOISON	0x4857504f49534f4e
>    526	extern void SetPageHWPoisonTakenOff(struct page *page);
>    527	extern void ClearPageHWPoisonTakenOff(struct page *page);
>    528	extern bool take_page_off_buddy(struct page *page);
>    529	extern bool put_page_back_buddy(struct page *page);
>    530	#else
>    531	PAGEFLAG_FALSE(HWPoison, hwpoison)
>    532	#define __PG_HWPOISON 0
>    533	#endif
>    534	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux