Re: [PATCH 06/12] mm/khugepaged: remove khugepaged prefix from shared collapse functions

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

 



Hi Zach,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on hnaz-mm/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Zach-O-Keefe/mm-userspace-hugepage-collapse/20220410-215722
base:   https://github.com/hnaz/linux-mm master
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220411/202204110041.MnMCeEi6-lkp@xxxxxxxxx/config)
compiler: arceb-elf-gcc (GCC) 11.2.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/18407cfcbdad0f4e11dfe2e40028687fc64093c5
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Zach-O-Keefe/mm-userspace-hugepage-collapse/20220410-215722
        git checkout 18407cfcbdad0f4e11dfe2e40028687fc64093c5
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash

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

All warnings (new ones prefixed by >>):

   mm/khugepaged.c: In function 'find_pmd_or_thp_or_none':
   mm/khugepaged.c:1019:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    1019 |         pmd_t pmde;
         |         ^~~~~
   mm/khugepaged.c: In function 'khugepaged':
   mm/khugepaged.c:2355:32: error: initialization of 'struct page * (*)(struct collapse_control *, gfp_t,  int)' {aka 'struct page * (*)(struct collapse_control *, unsigned int,  int)'} from incompatible pointer type 'struct page * (*)(struct collapse_control *, gfp_t)' {aka 'struct page * (*)(struct collapse_control *, unsigned int)'} [-Werror=incompatible-pointer-types]
    2355 |                 .alloc_hpage = &khugepaged_alloc_page,
         |                                ^
   mm/khugepaged.c:2355:32: note: (near initialization for 'cc.alloc_hpage')
   mm/khugepaged.c: At top level:
   mm/khugepaged.c:2469:5: warning: no previous prototype for 'madvise_collapse_errno' [-Wmissing-prototypes]
    2469 | int madvise_collapse_errno(enum scan_result r)
         |     ^~~~~~~~~~~~~~~~~~~~~~
   mm/khugepaged.c:914:12: warning: 'khugepaged_find_target_node' defined but not used [-Wunused-function]
     914 | static int khugepaged_find_target_node(struct collapse_control *cc)
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/khugepaged.c: In function 'collapse_file':
>> mm/khugepaged.c:863:55: warning: array subscript -2147483648 is below array bounds of 'int[1]' [-Warray-bounds]
     863 |                         if (max_value == cc->node_load[nid]) {
         |                                          ~~~~~~~~~~~~~^~~~~
   mm/khugepaged.c:91:13: note: while referencing 'node_load'
      91 |         int node_load[MAX_NUMNODES];
         |             ^~~~~~~~~
   mm/khugepaged.c: In function 'collapse_huge_page':
>> mm/khugepaged.c:863:55: warning: array subscript -2147483648 is below array bounds of 'int[1]' [-Warray-bounds]
     863 |                         if (max_value == cc->node_load[nid]) {
         |                                          ~~~~~~~~~~~~~^~~~~
   mm/khugepaged.c:91:13: note: while referencing 'node_load'
      91 |         int node_load[MAX_NUMNODES];
         |             ^~~~~~~~~
   cc1: some warnings being treated as errors


vim +863 mm/khugepaged.c

b46e756f5e4703 Kirill A. Shutemov 2016-07-26  847  
18407cfcbdad0f Zach O'Keefe       2022-04-10  848  static int find_target_node(struct collapse_control *cc)
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  849  {
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  850  	int nid, target_node = 0, max_value = 0;
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  851  
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  852  	/* find first node with max normal pages hit */
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  853  	for (nid = 0; nid < MAX_NUMNODES; nid++)
b6a99a2eb2cc19 Zach O'Keefe       2022-04-10  854  		if (cc->node_load[nid] > max_value) {
b6a99a2eb2cc19 Zach O'Keefe       2022-04-10  855  			max_value = cc->node_load[nid];
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  856  			target_node = nid;
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  857  		}
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  858  
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  859  	/* do some balance if several nodes have the same hit record */
b6a99a2eb2cc19 Zach O'Keefe       2022-04-10  860  	if (target_node <= cc->last_target_node)
b6a99a2eb2cc19 Zach O'Keefe       2022-04-10  861  		for (nid = cc->last_target_node + 1; nid < MAX_NUMNODES;
b6a99a2eb2cc19 Zach O'Keefe       2022-04-10  862  		     nid++) {
b6a99a2eb2cc19 Zach O'Keefe       2022-04-10 @863  			if (max_value == cc->node_load[nid]) {
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  864  				target_node = nid;
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  865  				break;
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  866  			}
b6a99a2eb2cc19 Zach O'Keefe       2022-04-10  867  		}
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  868  
b6a99a2eb2cc19 Zach O'Keefe       2022-04-10  869  	cc->last_target_node = target_node;
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  870  	return target_node;
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  871  }
b46e756f5e4703 Kirill A. Shutemov 2016-07-26  872  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp




[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