Content-Type: multipart/mixed; boundary="===============8751094060484850123==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [RFC PATCH V1 3/5] mm/damon: Add 'damon_region' NUMA access statistics core implementation Date: Wed, 16 Feb 2022 21:06:26 +0800 Message-ID: <202202162059.x4hUQVt5-lkp@intel.com> In-Reply-To: List-Id: --===============8751094060484850123== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Xin, [FYI, it's a private test report for your RFC patch.] [auto build test ERROR on linus/master] [also build test ERROR on v5.17-rc4] [cannot apply to hnaz-mm/master rostedt-trace/for-next next-20220216] [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] url: https://github.com/0day-ci/linux/commits/Xin-Hao/mm-damon-Add-NUMA-= access-statistics-function-support/20220216-163243 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git = c5d9ae265b105d9a67575fb67bd4650a6fc08e25 config: nios2-randconfig-r022-20220216 (https://download.01.org/0day-ci/arc= hive/20220216/202202162059.x4hUQVt5-lkp(a)intel.com/config) compiler: nios2-linux-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 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/0day-ci/linux/commit/f84003da496b71b9f13c4de14= 0de21d70a73a408 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Xin-Hao/mm-damon-Add-NUMA-access-s= tatistics-function-support/20220216-163243 git checkout f84003da496b71b9f13c4de140de21d70a73a408 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Dnios2 SHELL=3D/bin/bash mm/damon/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All error/warnings (new ones prefixed by >>): mm/damon/core.c: In function 'get_damon_target': >> mm/damon/core.c:1023:50: error: implicit declaration of function 'damon_= get_task_struct'; did you mean 'get_task_struct'? [-Werror=3Dimplicit-funct= ion-declaration] 1023 | struct task_struct *ts =3D damon_get_tas= k_struct(t); | ^~~~~~~~~~~~~~~= ~~~~~~ | get_task_struct >> mm/damon/core.c:1023:50: warning: initialization of 'struct task_struct = *' from 'int' makes pointer from integer without a cast [-Wint-conversion] mm/damon/core.c: At top level: >> mm/damon/core.c:1058:6: error: redefinition of 'damon_numa_fault' 1058 | void damon_numa_fault(int page_nid, int node_id, struct vm_fault= *vmf) | ^~~~~~~~~~~~~~~~ In file included from mm/damon/core.c:10: include/linux/damon.h:525:20: note: previous definition of 'damon_numa_f= ault' with type 'void(int, int, struct vm_fault *)' 525 | static inline void damon_numa_fault(int page_nid, int node_id, s= truct vm_fault *vmf) { } | ^~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +1023 mm/damon/core.c 1009 = 1010 static struct damon_target *get_damon_target(struct task_struct *tas= k) 1011 { 1012 int i; 1013 unsigned long id1, id2; 1014 struct damon_target *t; 1015 = 1016 rcu_read_lock(); 1017 for (i =3D 0; i < READ_ONCE(dbgfs_nr_ctxs); i++) { 1018 struct damon_ctx *ctx =3D rcu_dereference(dbgfs_ctxs[i]); 1019 = 1020 if (!ctx || !ctx->kdamond) 1021 continue; 1022 damon_for_each_target(t, dbgfs_ctxs[i]) { > 1023 struct task_struct *ts =3D damon_get_task_struct(t); 1024 = 1025 if (ts) { 1026 id1 =3D (unsigned long)pid_vnr((struct pid *)t->id); 1027 id2 =3D (unsigned long)pid_vnr(get_task_pid(task, PIDTYPE_PID)); 1028 put_task_struct(ts); 1029 if (id1 =3D=3D id2) 1030 return t; 1031 } 1032 } 1033 } 1034 rcu_read_unlock(); 1035 = 1036 return NULL; 1037 } 1038 = 1039 static struct damon_region *get_damon_region(struct damon_target *t,= unsigned long addr) 1040 { 1041 struct damon_region *r, *next; 1042 = 1043 if (!t || !addr) 1044 return NULL; 1045 = 1046 spin_lock(&t->target_lock); 1047 damon_for_each_region_safe(r, next, t) { 1048 if (r->ar.start <=3D addr && r->ar.end >=3D addr) { 1049 spin_unlock(&t->target_lock); 1050 return r; 1051 } 1052 } 1053 spin_unlock(&t->target_lock); 1054 = 1055 return NULL; 1056 } 1057 = > 1058 void damon_numa_fault(int page_nid, int node_id, struct vm_fault *vm= f) 1059 { 1060 struct damon_target *t; 1061 struct damon_region *r; 1062 = 1063 if (nr_online_nodes > 1) { 1064 t =3D get_damon_target(current); 1065 if (!t) 1066 return; 1067 r =3D get_damon_region(t, vmf->address); 1068 if (r) { 1069 if (page_nid =3D=3D node_id) 1070 r->local++; 1071 else 1072 r->remote++; 1073 } 1074 } 1075 } 1076 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============8751094060484850123==--