Re: [PATCH] mm: mempolicy: N:M interleave policy for tiered memory nodes

From: kernel test robot
Date: Wed Jun 08 2022 - 19:45:51 EST


Hi Johannes,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on akpm-mm/mm-everything]

url: https://github.com/intel-lab-lkp/linux/commits/Johannes-Weiner/mm-mempolicy-N-M-interleave-policy-for-tiered-memory-nodes/20220608-012652
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
config: x86_64-randconfig-a003 (https://download.01.org/0day-ci/archive/20220609/202206090708.jaGUnz8e-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project b92436efcb7813fc481b30f2593a4907568d917a)
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/876d8daa0642d35f71ff504eeb3be4b950339a45
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Johannes-Weiner/mm-mempolicy-N-M-interleave-policy-for-tiered-memory-nodes/20220608-012652
git checkout 876d8daa0642d35f71ff504eeb3be4b950339a45
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

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

All warnings (new ones prefixed by >>):

>> mm/mempolicy.c:1890:11: warning: variable 'next' is used uninitialized whenever function 'next_node_tier' is called [-Wsometimes-uninitialized]
unsigned next, start = nid;
~~~~~~~~~^~~~
mm/mempolicy.c:1893:23: note: uninitialized use occurs here
next = next_node_in(next, policy->nodes);
^~~~
include/linux/nodemask.h:278:46: note: expanded from macro 'next_node_in'
#define next_node_in(n, src) __next_node_in((n), &(src))
^
mm/mempolicy.c:1890:15: note: initialize the variable 'next' to silence this warning
unsigned next, start = nid;
^
= 0
1 warning generated.


vim +1890 mm/mempolicy.c

1887
1888 static unsigned next_node_tier(int nid, struct mempolicy *policy, bool toptier)
1889 {
> 1890 unsigned next, start = nid;
1891
1892 do {
1893 next = next_node_in(next, policy->nodes);
1894 if (next == MAX_NUMNODES)
1895 break;
1896 if (toptier == node_is_toptier(next))
1897 break;
1898 } while (next != start);
1899 return next;
1900 }
1901

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