CC: [email protected]
CC: [email protected]
TO: Zhenguo Yao <[email protected]>
CC: Johannes Weiner <[email protected]>
CC: Andrew Morton <[email protected]>
CC: Linux Memory Management List <[email protected]>

tree:   https://github.com/hnaz/linux-mm master
head:   2da980116934414a1c45f4c88e1c56e4cd01b86e
commit: 83a94fca79254b50ab85743e3e20773de9ec26f7 [117/223] hugetlbfs: extend 
the definition of hugepages parameter to support node allocation
:::::: branch date: 19 hours ago
:::::: commit date: 19 hours ago
config: i386-randconfig-m021-20211001 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
mm/hugetlb.c:2957 __alloc_bootmem_huge_page() warn: ignoring unreachable code.
mm/hugetlb.c:4130 hugepages_setup() warn: potential spectre issue 
'default_hugepages_in_node' [w] (local cap)
mm/hugetlb.c:4132 hugepages_setup() warn: potential spectre issue 
'parsed_hstate->max_huge_pages_node' [w] (local cap)

vim +2957 mm/hugetlb.c

b45b5bd65f668a David Gibson      2006-03-22  2937  
83a94fca79254b Zhenguo Yao       2021-09-30  2938  int 
alloc_bootmem_huge_page(struct hstate *h, int nid)
e24a1307ba1f99 Aneesh Kumar K.V  2017-07-28  2939       __attribute__ ((weak, 
alias("__alloc_bootmem_huge_page")));
83a94fca79254b Zhenguo Yao       2021-09-30  2940  int 
__alloc_bootmem_huge_page(struct hstate *h, int nid)
aa888a74977a8f Andi Kleen        2008-07-23  2941  {
aa888a74977a8f Andi Kleen        2008-07-23  2942       struct 
huge_bootmem_page *m;
b2261026825ed3 Joonsoo Kim       2013-09-11  2943       int nr_nodes, node;
aa888a74977a8f Andi Kleen        2008-07-23  2944  
83a94fca79254b Zhenguo Yao       2021-09-30  2945       if (nid >= 
nr_online_nodes)
83a94fca79254b Zhenguo Yao       2021-09-30  2946               return 0;
83a94fca79254b Zhenguo Yao       2021-09-30  2947       /* do node specific 
alloc */
83a94fca79254b Zhenguo Yao       2021-09-30  2948       if (nid != 
NUMA_NO_NODE) {
83a94fca79254b Zhenguo Yao       2021-09-30  2949               m = 
memblock_alloc_try_nid_raw(huge_page_size(h), huge_page_size(h),
83a94fca79254b Zhenguo Yao       2021-09-30  2950                               
0, MEMBLOCK_ALLOC_ACCESSIBLE, nid);
83a94fca79254b Zhenguo Yao       2021-09-30  2951               if (m)
83a94fca79254b Zhenguo Yao       2021-09-30  2952                       goto 
found;
83a94fca79254b Zhenguo Yao       2021-09-30  2953               else
83a94fca79254b Zhenguo Yao       2021-09-30  2954                       return 
0;
83a94fca79254b Zhenguo Yao       2021-09-30  2955       }
83a94fca79254b Zhenguo Yao       2021-09-30  2956       /* do all node balanced 
alloc */
b2261026825ed3 Joonsoo Kim       2013-09-11 @2957       
for_each_node_mask_to_alloc(h, nr_nodes, node, &node_states[N_MEMORY]) {
83a94fca79254b Zhenguo Yao       2021-09-30  2958               m = 
memblock_alloc_try_nid_raw(
8b89a116943754 Grygorii Strashko 2014-01-21  2959                               
huge_page_size(h), huge_page_size(h),
97ad1087efffed Mike Rapoport     2018-10-30  2960                               
0, MEMBLOCK_ALLOC_ACCESSIBLE, node);
aa888a74977a8f Andi Kleen        2008-07-23  2961               /*
aa888a74977a8f Andi Kleen        2008-07-23  2962                * Use the 
beginning of the huge page to store the
aa888a74977a8f Andi Kleen        2008-07-23  2963                * 
huge_bootmem_page struct (until gather_bootmem
aa888a74977a8f Andi Kleen        2008-07-23  2964                * puts them 
into the mem_map).
aa888a74977a8f Andi Kleen        2008-07-23  2965                */
83a94fca79254b Zhenguo Yao       2021-09-30  2966               if (m)
aa888a74977a8f Andi Kleen        2008-07-23  2967                       goto 
found;
83a94fca79254b Zhenguo Yao       2021-09-30  2968               else
aa888a74977a8f Andi Kleen        2008-07-23  2969                       return 
0;
83a94fca79254b Zhenguo Yao       2021-09-30  2970       }
aa888a74977a8f Andi Kleen        2008-07-23  2971  
aa888a74977a8f Andi Kleen        2008-07-23  2972  found:
aa888a74977a8f Andi Kleen        2008-07-23  2973       /* Put them into a 
private list first because mem_map is not up yet */
330d6e489a0ab4 Cannon Matthews   2018-08-17  2974       
INIT_LIST_HEAD(&m->list);
aa888a74977a8f Andi Kleen        2008-07-23  2975       list_add(&m->list, 
&huge_boot_pages);
aa888a74977a8f Andi Kleen        2008-07-23  2976       m->hstate = h;
aa888a74977a8f Andi Kleen        2008-07-23  2977       return 1;
aa888a74977a8f Andi Kleen        2008-07-23  2978  }
aa888a74977a8f Andi Kleen        2008-07-23  2979  

:::::: The code at line 2957 was first introduced by commit
:::::: b2261026825ed34066b24069359d118098bb1876 mm, hugetlb: fix and clean-up 
node iteration code to alloc or free

:::::: TO: Joonsoo Kim <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to