Re: [sj:damon/next 27/34] mm/damon/sysfs-schemes.c:1409:19: error: incomplete definition of type 'struct mem_cgroup'
From: SeongJae Park
Date: Mon Nov 28 2022 - 13:12:43 EST
Hello Robot,
On Mon, 28 Nov 2022 12:00:58 +0800 kernel test robot <lkp@xxxxxxxxx> wrote:
> [-- Attachment #1: Type: text/plain, Size: 1995 bytes --]
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
> head: c68bc40dc2022ce015ee828d0fccb34f864934f8
> commit: 80bd927ee54ff864d9a6ceb1c6ce4803b22e7220 [27/34] mm/damon/sysfs-schemes: implement scheme filters
> config: x86_64-randconfig-r015-20221128
> compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
> 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://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git/commit/?id=80bd927ee54ff864d9a6ceb1c6ce4803b22e7220
> git remote add sj https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git
> git fetch --no-tags sj damon/next
> git checkout 80bd927ee54ff864d9a6ceb1c6ce4803b22e7220
> # 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 errors (new ones prefixed by >>):
>
> >> mm/damon/sysfs-schemes.c:1409:19: error: incomplete definition of type 'struct mem_cgroup'
> cgroup_path(memcg->css.cgroup, memcg_path_buf, PATH_MAX);
> ~~~~~^
> include/linux/mm_types.h:33:8: note: forward declaration of 'struct mem_cgroup'
> struct mem_cgroup;
> ^
> 1 error generated.
>
>
> vim +1409 mm/damon/sysfs-schemes.c
>
> 1404
> 1405 static bool damon_sysfs_memcg_path_eq(struct mem_cgroup *memcg,
> 1406 char *memcg_path_buf, char *path)
> 1407 {
> 1408 #ifdef CONFIG_CGROUPS
> > 1409 cgroup_path(memcg->css.cgroup, memcg_path_buf, PATH_MAX);
> 1410 if (sysfs_streq(memcg_path_buf, path))
> 1411 return true;
> 1412 #endif
'struct mem_cgroup' is defined under '#ifdef CONFIG_MEMCG', so this should be
guarded with it. Fixed it[1]. Thank you again!
[1] https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git/commit/?h=damon/next&id=dc31f4ababd073e1686de0e51f45c5bbd42e66ac
Thanks,
SJ
> 1413 return false;
> 1414 }
> 1415