Re: [PATCH v13 06/18] mm/memcg: Add folio_memcg() and related functions

From: kernel test robot
Date: Mon Jul 12 2021 - 17:57:11 EST


Hi "Matthew,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.14-rc1 next-20210712]
[cannot apply to hnaz-linux-mm/master tip/perf/core linux/master]
[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/Matthew-Wilcox-Oracle/Convert-memcg-to-folios/20210713-035650
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e73f0f0ee7541171d89f2e2491130c7771ba58d3
config: i386-randconfig-p002-20210712 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/90cfa1fbae827b338bee737e073ffab84823bfed
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matthew-Wilcox-Oracle/Convert-memcg-to-folios/20210713-035650
git checkout 90cfa1fbae827b338bee737e073ffab84823bfed
# save the attached .config to linux build tree
make W=1 ARCH=i386

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

All errors (new ones prefixed by >>):

In file included from include/linux/kallsyms.h:13,
from include/linux/bpf.h:20,
from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1380 | static inline int folio_nid(const struct folio *folio)
| ^~~~~
include/linux/mm.h: In function 'folio_nid':
>> include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
1382 | return page_to_nid(&folio->page);
| ^~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:375:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:399:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_memcg':
include/linux/memcontrol.h:401:34: error: dereferencing pointer to incomplete type 'struct folio'
401 | unsigned long memcg_data = folio->memcg_data;
| ^~
>> include/linux/memcontrol.h:403:2: error: implicit declaration of function 'VM_BUG_ON_FOLIO'; did you mean 'VM_BUG_ON_MM'? [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~~~~~~
| VM_BUG_ON_MM
>> include/linux/memcontrol.h:403:18: error: implicit declaration of function 'folio_slab' [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:420:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_objcg':
include/linux/memcontrol.h:422:34: error: dereferencing pointer to incomplete type 'struct folio'
422 | unsigned long memcg_data = folio->memcg_data;
| ^~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:451:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_memcg':
>> include/linux/memcontrol.h:453:23: error: passing argument 1 of 'folio_memcg_kmem' from incompatible pointer type [-Werror=incompatible-pointer-types]
453 | if (folio_memcg_kmem(folio))
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:375:51: note: expected 'struct folio *' but argument is of type 'struct folio *'
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:454:41: error: passing argument 1 of '__folio_objcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
454 | return obj_cgroup_memcg(__folio_objcg(folio));
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:420:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:455:23: error: passing argument 1 of '__folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
455 | return __folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:399:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: In function 'page_memcg':
>> include/linux/memcontrol.h:460:21: error: implicit declaration of function 'page_folio' [-Werror=implicit-function-declaration]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~
include/linux/memcontrol.h:460:21: warning: passing argument 1 of 'folio_memcg' makes pointer from integer without a cast [-Wint-conversion]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'int'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:540:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
>> include/linux/memcontrol.h:540:20: error: conflicting types for 'folio_memcg_kmem'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~~~~~~~~~~~~
include/linux/memcontrol.h:375:20: note: previous declaration of 'folio_memcg_kmem' was here
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
In file included from include/asm-generic/atomic-instrumented.h:20,
from include/linux/atomic.h:81,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
include/linux/memcontrol.h: In function 'folio_memcg_kmem':
include/linux/memcontrol.h:542:35: error: dereferencing pointer to incomplete type 'struct folio'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~
include/linux/build_bug.h:30:63: note: in definition of macro 'BUILD_BUG_ON_INVALID'
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ^
include/linux/memcontrol.h:542:2: note: in expansion of macro 'VM_BUG_ON_PGFLAGS'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: In function 'PageMemcgKmem':
include/linux/memcontrol.h:606:26: warning: passing argument 1 of 'folio_memcg_kmem' makes pointer from integer without a cast [-Wint-conversion]
606 | return folio_memcg_kmem(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:540:51: note: expected 'struct folio *' but argument is of type 'int'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
arch/x86/kernel/asm-offsets.c: At top level:
include/linux/memcontrol.h:375:20: warning: 'folio_memcg_kmem' used but never defined
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from include/linux/kallsyms.h:13,
from include/linux/bpf.h:20,
from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1380 | static inline int folio_nid(const struct folio *folio)
| ^~~~~
include/linux/mm.h: In function 'folio_nid':
>> include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
1382 | return page_to_nid(&folio->page);
| ^~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:375:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:399:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_memcg':
include/linux/memcontrol.h:401:34: error: dereferencing pointer to incomplete type 'struct folio'
401 | unsigned long memcg_data = folio->memcg_data;
| ^~
>> include/linux/memcontrol.h:403:2: error: implicit declaration of function 'VM_BUG_ON_FOLIO'; did you mean 'VM_BUG_ON_MM'? [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~~~~~~
| VM_BUG_ON_MM
>> include/linux/memcontrol.h:403:18: error: implicit declaration of function 'folio_slab' [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:420:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_objcg':
include/linux/memcontrol.h:422:34: error: dereferencing pointer to incomplete type 'struct folio'
422 | unsigned long memcg_data = folio->memcg_data;
| ^~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:451:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_memcg':
>> include/linux/memcontrol.h:453:23: error: passing argument 1 of 'folio_memcg_kmem' from incompatible pointer type [-Werror=incompatible-pointer-types]
453 | if (folio_memcg_kmem(folio))
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:375:51: note: expected 'struct folio *' but argument is of type 'struct folio *'
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:454:41: error: passing argument 1 of '__folio_objcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
454 | return obj_cgroup_memcg(__folio_objcg(folio));
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:420:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:455:23: error: passing argument 1 of '__folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
455 | return __folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:399:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: In function 'page_memcg':
>> include/linux/memcontrol.h:460:21: error: implicit declaration of function 'page_folio' [-Werror=implicit-function-declaration]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~
include/linux/memcontrol.h:460:21: warning: passing argument 1 of 'folio_memcg' makes pointer from integer without a cast [-Wint-conversion]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'int'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:540:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
>> include/linux/memcontrol.h:540:20: error: conflicting types for 'folio_memcg_kmem'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~~~~~~~~~~~~
include/linux/memcontrol.h:375:20: note: previous declaration of 'folio_memcg_kmem' was here
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
In file included from include/asm-generic/atomic-instrumented.h:20,
from include/linux/atomic.h:81,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
include/linux/memcontrol.h: In function 'folio_memcg_kmem':
include/linux/memcontrol.h:542:35: error: dereferencing pointer to incomplete type 'struct folio'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~
include/linux/build_bug.h:30:63: note: in definition of macro 'BUILD_BUG_ON_INVALID'
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ^
include/linux/memcontrol.h:542:2: note: in expansion of macro 'VM_BUG_ON_PGFLAGS'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: In function 'PageMemcgKmem':
include/linux/memcontrol.h:606:26: warning: passing argument 1 of 'folio_memcg_kmem' makes pointer from integer without a cast [-Wint-conversion]
606 | return folio_memcg_kmem(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:540:51: note: expected 'struct folio *' but argument is of type 'int'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
arch/x86/kernel/asm-offsets.c: At top level:
include/linux/memcontrol.h:375:20: warning: 'folio_memcg_kmem' used but never defined
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1212: prepare0] Error 2
make[1]: Target 'modules_prepare' not remade because of errors.
make: *** [Makefile:220: __sub-make] Error 2
make: Target 'modules_prepare' not remade because of errors.
--
In file included from include/linux/kallsyms.h:13,
from include/linux/bpf.h:20,
from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
1380 | static inline int folio_nid(const struct folio *folio)
| ^~~~~
include/linux/mm.h: In function 'folio_nid':
>> include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
1382 | return page_to_nid(&folio->page);
| ^~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:375:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~
include/linux/memcontrol.h:399:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_memcg':
include/linux/memcontrol.h:401:34: error: dereferencing pointer to incomplete type 'struct folio'
401 | unsigned long memcg_data = folio->memcg_data;
| ^~
>> include/linux/memcontrol.h:403:2: error: implicit declaration of function 'VM_BUG_ON_FOLIO'; did you mean 'VM_BUG_ON_MM'? [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~~~~~~
| VM_BUG_ON_MM
>> include/linux/memcontrol.h:403:18: error: implicit declaration of function 'folio_slab' [-Werror=implicit-function-declaration]
403 | VM_BUG_ON_FOLIO(folio_slab(folio), folio);
| ^~~~~~~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:420:55: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function '__folio_objcg':
include/linux/memcontrol.h:422:34: error: dereferencing pointer to incomplete type 'struct folio'
422 | unsigned long memcg_data = folio->memcg_data;
| ^~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:451:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ^~~~~
include/linux/memcontrol.h: In function 'folio_memcg':
>> include/linux/memcontrol.h:453:23: error: passing argument 1 of 'folio_memcg_kmem' from incompatible pointer type [-Werror=incompatible-pointer-types]
453 | if (folio_memcg_kmem(folio))
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:375:51: note: expected 'struct folio *' but argument is of type 'struct folio *'
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:454:41: error: passing argument 1 of '__folio_objcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
454 | return obj_cgroup_memcg(__folio_objcg(folio));
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:420:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
420 | static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
>> include/linux/memcontrol.h:455:23: error: passing argument 1 of '__folio_memcg' from incompatible pointer type [-Werror=incompatible-pointer-types]
455 | return __folio_memcg(folio);
| ^~~~~
| |
| struct folio *
include/linux/memcontrol.h:399:62: note: expected 'struct folio *' but argument is of type 'struct folio *'
399 | static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: In function 'page_memcg':
>> include/linux/memcontrol.h:460:21: error: implicit declaration of function 'page_folio' [-Werror=implicit-function-declaration]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~
include/linux/memcontrol.h:460:21: warning: passing argument 1 of 'folio_memcg' makes pointer from integer without a cast [-Wint-conversion]
460 | return folio_memcg(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:451:60: note: expected 'struct folio *' but argument is of type 'int'
451 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
include/linux/memcontrol.h: At top level:
include/linux/memcontrol.h:540:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~
>> include/linux/memcontrol.h:540:20: error: conflicting types for 'folio_memcg_kmem'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ^~~~~~~~~~~~~~~~
include/linux/memcontrol.h:375:20: note: previous declaration of 'folio_memcg_kmem' was here
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
In file included from include/asm-generic/atomic-instrumented.h:20,
from include/linux/atomic.h:81,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
include/linux/memcontrol.h: In function 'folio_memcg_kmem':
include/linux/memcontrol.h:542:35: error: dereferencing pointer to incomplete type 'struct folio'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~
include/linux/build_bug.h:30:63: note: in definition of macro 'BUILD_BUG_ON_INVALID'
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ^
include/linux/memcontrol.h:542:2: note: in expansion of macro 'VM_BUG_ON_PGFLAGS'
542 | VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/memcontrol.h: In function 'PageMemcgKmem':
include/linux/memcontrol.h:606:26: warning: passing argument 1 of 'folio_memcg_kmem' makes pointer from integer without a cast [-Wint-conversion]
606 | return folio_memcg_kmem(page_folio(page));
| ^~~~~~~~~~~~~~~~
| |
| int
include/linux/memcontrol.h:540:51: note: expected 'struct folio *' but argument is of type 'int'
540 | static inline bool folio_memcg_kmem(struct folio *folio)
| ~~~~~~~~~~~~~~^~~~~
arch/x86/kernel/asm-offsets.c: At top level:
include/linux/memcontrol.h:375:20: warning: 'folio_memcg_kmem' used but never defined
375 | static inline bool folio_memcg_kmem(struct folio *folio);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1212: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:220: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.


vim +403 include/linux/memcontrol.h

388
389 /*
390 * __folio_memcg - Get the memory cgroup associated with a non-kmem folio
391 * @folio: Pointer to the folio.
392 *
393 * Returns a pointer to the memory cgroup associated with the folio,
394 * or NULL. This function assumes that the folio is known to have a
395 * proper memory cgroup pointer. It's not safe to call this function
396 * against some type of folios, e.g. slab folios or ex-slab folios or
397 * kmem folios.
398 */
399 static inline struct mem_cgroup *__folio_memcg(struct folio *folio)
400 {
401 unsigned long memcg_data = folio->memcg_data;
402
> 403 VM_BUG_ON_FOLIO(folio_slab(folio), folio);
404 VM_BUG_ON_FOLIO(memcg_data & MEMCG_DATA_OBJCGS, folio);
405 VM_BUG_ON_FOLIO(memcg_data & MEMCG_DATA_KMEM, folio);
406
407 return (struct mem_cgroup *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
408 }
409
410 /*
411 * __folio_objcg - get the object cgroup associated with a kmem folio.
412 * @folio: Pointer to the folio.
413 *
414 * Returns a pointer to the object cgroup associated with the folio,
415 * or NULL. This function assumes that the folio is known to have a
416 * proper object cgroup pointer. It's not safe to call this function
417 * against some type of folios, e.g. slab folios or ex-slab folios or
418 * LRU folios.
419 */
420 static inline struct obj_cgroup *__folio_objcg(struct folio *folio)
421 {
422 unsigned long memcg_data = folio->memcg_data;
423
424 VM_BUG_ON_FOLIO(folio_slab(folio), folio);
425 VM_BUG_ON_FOLIO(memcg_data & MEMCG_DATA_OBJCGS, folio);
426 VM_BUG_ON_FOLIO(!(memcg_data & MEMCG_DATA_KMEM), folio);
427
428 return (struct obj_cgroup *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
429 }
430
431 /*
432 * folio_memcg - Get the memory cgroup associated with a folio.
433 * @folio: Pointer to the folio.
434 *
435 * Returns a pointer to the memory cgroup associated with the folio,
436 * or NULL. This function assumes that the folio is known to have a
437 * proper memory cgroup pointer. It's not safe to call this function
438 * against some type of folios, e.g. slab folios or ex-slab folios.
439 *
440 * For a non-kmem folio any of the following ensures folio and memcg binding
441 * stability:
442 *
443 * - the folio lock
444 * - LRU isolation
445 * - lock_page_memcg()
446 * - exclusive reference
447 *
448 * For a kmem folio a caller should hold an rcu read lock to protect memcg
449 * associated with a kmem folio from being released.
450 */
451 static inline struct mem_cgroup *folio_memcg(struct folio *folio)
452 {
> 453 if (folio_memcg_kmem(folio))
> 454 return obj_cgroup_memcg(__folio_objcg(folio));
> 455 return __folio_memcg(folio);
456 }
457
458 static inline struct mem_cgroup *page_memcg(struct page *page)
459 {
> 460 return folio_memcg(page_folio(page));
461 }
462
463 /*
464 * page_memcg_rcu - locklessly get the memory cgroup associated with a page
465 * @page: a pointer to the page struct
466 *
467 * Returns a pointer to the memory cgroup associated with the page,
468 * or NULL. This function assumes that the page is known to have a
469 * proper memory cgroup pointer. It's not safe to call this function
470 * against some type of pages, e.g. slab pages or ex-slab pages.
471 */
472 static inline struct mem_cgroup *page_memcg_rcu(struct page *page)
473 {
474 unsigned long memcg_data = READ_ONCE(page->memcg_data);
475
476 VM_BUG_ON_PAGE(PageSlab(page), page);
477 WARN_ON_ONCE(!rcu_read_lock_held());
478
479 if (memcg_data & MEMCG_DATA_KMEM) {
480 struct obj_cgroup *objcg;
481
482 objcg = (void *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
483 return obj_cgroup_memcg(objcg);
484 }
485
486 return (struct mem_cgroup *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
487 }
488
489 /*
490 * page_memcg_check - get the memory cgroup associated with a page
491 * @page: a pointer to the page struct
492 *
493 * Returns a pointer to the memory cgroup associated with the page,
494 * or NULL. This function unlike page_memcg() can take any page
495 * as an argument. It has to be used in cases when it's not known if a page
496 * has an associated memory cgroup pointer or an object cgroups vector or
497 * an object cgroup.
498 *
499 * For a non-kmem page any of the following ensures page and memcg binding
500 * stability:
501 *
502 * - the page lock
503 * - LRU isolation
504 * - lock_page_memcg()
505 * - exclusive reference
506 *
507 * For a kmem page a caller should hold an rcu read lock to protect memcg
508 * associated with a kmem page from being released.
509 */
510 static inline struct mem_cgroup *page_memcg_check(struct page *page)
511 {
512 /*
513 * Because page->memcg_data might be changed asynchronously
514 * for slab pages, READ_ONCE() should be used here.
515 */
516 unsigned long memcg_data = READ_ONCE(page->memcg_data);
517
518 if (memcg_data & MEMCG_DATA_OBJCGS)
519 return NULL;
520
521 if (memcg_data & MEMCG_DATA_KMEM) {
522 struct obj_cgroup *objcg;
523
524 objcg = (void *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
525 return obj_cgroup_memcg(objcg);
526 }
527
528 return (struct mem_cgroup *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK);
529 }
530
531 #ifdef CONFIG_MEMCG_KMEM
532 /*
533 * folio_memcg_kmem - Check if the folio has the memcg_kmem flag set.
534 * @folio: Pointer to the folio.
535 *
536 * Checks if the folio has MemcgKmem flag set. The caller must ensure
537 * that the folio has an associated memory cgroup. It's not safe to call
538 * this function against some types of folios, e.g. slab folios.
539 */
> 540 static inline bool folio_memcg_kmem(struct folio *folio)
541 {
542 VM_BUG_ON_PGFLAGS(PageTail(&folio->page), &folio->page);
543 VM_BUG_ON_FOLIO(folio->memcg_data & MEMCG_DATA_OBJCGS, folio);
544 return folio->memcg_data & MEMCG_DATA_KMEM;
545 }
546

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip