All of lore.kernel.org
 help / color / mirror / Atom feed
* [akpm-mm:mm-unstable 179/192] mm/zswap.c:298:24: error: call to undeclared function 'obj_cgroup_memcg'; ISO C99 and later do not support implicit function declarations
@ 2023-11-29 15:42 kernel test robot
  2023-11-29 21:34 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2023-11-29 15:42 UTC (permalink / raw)
  To: Domenico Cerasuolo
  Cc: oe-kbuild-all, Andrew Morton, Linux Memory Management List, Nhat Pham

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
head:   cb1d236cb1038fa1bbae9913803f1c655b86d931
commit: 70dd375afcfe1839321ea8a65749404a99f0e773 [179/192] zswap: make shrinking memcg-aware
config: s390-randconfig-r071-20231129 (https://download.01.org/0day-ci/archive/20231129/202311292305.43bnw55s-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231129/202311292305.43bnw55s-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311292305.43bnw55s-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from mm/zswap.c:26:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:78:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
                                                             ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
   #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
                                                        ^
   In file included from mm/zswap.c:26:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:78:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
   #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
                                                        ^
   In file included from mm/zswap.c:26:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:78:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsb(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsw(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsl(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesb(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesw(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesl(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
>> mm/zswap.c:298:24: error: call to undeclared function 'obj_cgroup_memcg'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           return entry->objcg ? obj_cgroup_memcg(entry->objcg) : NULL;
                                 ^
   mm/zswap.c:298:24: note: did you mean 'obj_cgroup_put'?
   include/linux/memcontrol.h:1352:20: note: 'obj_cgroup_put' declared here
   static inline void obj_cgroup_put(struct obj_cgroup *objcg)
                      ^
   mm/zswap.c:298:22: warning: pointer/integer type mismatch in conditional expression ('int' and 'void *') [-Wconditional-type-mismatch]
           return entry->objcg ? obj_cgroup_memcg(entry->objcg) : NULL;
                               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~
>> mm/zswap.c:825:17: error: incomplete definition of type 'struct mem_cgroup'
                   css_get(&memcg->css);
                            ~~~~~^
   include/linux/mm_types.h:33:8: note: forward declaration of 'struct mem_cgroup'
   struct mem_cgroup;
          ^
   13 warnings and 2 errors generated.


vim +/obj_cgroup_memcg +298 mm/zswap.c

   294	
   295	/* should be called under RCU */
   296	static inline struct mem_cgroup *mem_cgroup_from_entry(struct zswap_entry *entry)
   297	{
 > 298		return entry->objcg ? obj_cgroup_memcg(entry->objcg) : NULL;
   299	}
   300	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [akpm-mm:mm-unstable 179/192] mm/zswap.c:298:24: error: call to undeclared function 'obj_cgroup_memcg'; ISO C99 and later do not support implicit function declarations
  2023-11-29 15:42 [akpm-mm:mm-unstable 179/192] mm/zswap.c:298:24: error: call to undeclared function 'obj_cgroup_memcg'; ISO C99 and later do not support implicit function declarations kernel test robot
@ 2023-11-29 21:34 ` Andrew Morton
  2023-11-30  1:53   ` Nhat Pham
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2023-11-29 21:34 UTC (permalink / raw)
  To: kernel test robot
  Cc: Domenico Cerasuolo, oe-kbuild-all, Linux Memory Management List,
	Nhat Pham

On Wed, 29 Nov 2023 23:42:15 +0800 kernel test robot <lkp@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
> head:   cb1d236cb1038fa1bbae9913803f1c655b86d931
> commit: 70dd375afcfe1839321ea8a65749404a99f0e773 [179/192] zswap: make shrinking memcg-aware
> config: s390-randconfig-r071-20231129 (https://download.01.org/0day-ci/archive/20231129/202311292305.43bnw55s-lkp@intel.com/config)
> compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231129/202311292305.43bnw55s-lkp@intel.com/reproduce)
> 
> ...
>
> >> mm/zswap.c:298:24: error: call to undeclared function 'obj_cgroup_memcg'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>            return entry->objcg ? obj_cgroup_memcg(entry->objcg) : NULL;
>                                  ^
>    mm/zswap.c:298:24: note: did you mean 'obj_cgroup_put'?
>    include/linux/memcontrol.h:1352:20: note: 'obj_cgroup_put' declared here

Well I'm going to assume it's this:

--- a/mm/zswap.c~zswap-make-shrinking-memcg-aware-fix
+++ a/mm/zswap.c
@@ -29,6 +29,7 @@
 #include <linux/zpool.h>
 #include <crypto/acompress.h>
 #include <linux/zswap.h>
+#include <linux/memcontrol.h>
 #include <linux/mm_types.h>
 #include <linux/page-flags.h>
 #include <linux/swapops.h>
_

Can't test because my gcc plugins have gone stupid yet again.

cc1: error: cannot load plugin ./scripts/gcc-plugins/stackleak_plugin.so: ./scripts/gcc-plugins/stackleak_plugin.so: undefined symbol: _ZNK6frange6acceptERK14vrange_visitor
cc1: error: cannot load plugin ./scripts/gcc-plugins/randomize_layout_plugin.so: ./scripts/gcc-plugins/randomize_layout_plugin.so: undefined symbol: _ZNK6frange6acceptERK14vrange_visitor

help.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [akpm-mm:mm-unstable 179/192] mm/zswap.c:298:24: error: call to undeclared function 'obj_cgroup_memcg'; ISO C99 and later do not support implicit function declarations
  2023-11-29 21:34 ` Andrew Morton
@ 2023-11-30  1:53   ` Nhat Pham
  0 siblings, 0 replies; 3+ messages in thread
From: Nhat Pham @ 2023-11-30  1:53 UTC (permalink / raw)
  To: Andrew Morton
  Cc: kernel test robot, Domenico Cerasuolo, oe-kbuild-all,
	Linux Memory Management List

On Wed, Nov 29, 2023 at 1:34 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Wed, 29 Nov 2023 23:42:15 +0800 kernel test robot <lkp@intel.com> wrote:
>
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
> > head:   cb1d236cb1038fa1bbae9913803f1c655b86d931
> > commit: 70dd375afcfe1839321ea8a65749404a99f0e773 [179/192] zswap: make shrinking memcg-aware
> > config: s390-randconfig-r071-20231129 (https://download.01.org/0day-ci/archive/20231129/202311292305.43bnw55s-lkp@intel.com/config)
> > compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231129/202311292305.43bnw55s-lkp@intel.com/reproduce)
> >
> > ...
> >
> > >> mm/zswap.c:298:24: error: call to undeclared function 'obj_cgroup_memcg'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> >            return entry->objcg ? obj_cgroup_memcg(entry->objcg) : NULL;
> >                                  ^
> >    mm/zswap.c:298:24: note: did you mean 'obj_cgroup_put'?
> >    include/linux/memcontrol.h:1352:20: note: 'obj_cgroup_put' declared here
>
> Well I'm going to assume it's this:
>
> --- a/mm/zswap.c~zswap-make-shrinking-memcg-aware-fix
> +++ a/mm/zswap.c
> @@ -29,6 +29,7 @@
>  #include <linux/zpool.h>
>  #include <crypto/acompress.h>
>  #include <linux/zswap.h>
> +#include <linux/memcontrol.h>
>  #include <linux/mm_types.h>
>  #include <linux/page-flags.h>
>  #include <linux/swapops.h>
> _
>
> Can't test because my gcc plugins have gone stupid yet again.
>
> cc1: error: cannot load plugin ./scripts/gcc-plugins/stackleak_plugin.so: ./scripts/gcc-plugins/stackleak_plugin.so: undefined symbol: _ZNK6frange6acceptERK14vrange_visitor
> cc1: error: cannot load plugin ./scripts/gcc-plugins/randomize_layout_plugin.so: ./scripts/gcc-plugins/randomize_layout_plugin.so: undefined symbol: _ZNK6frange6acceptERK14vrange_visitor
>
> help.

Hmm I tried including memcontrol.h, and it still screams at me the
same way with !CONFIG_MEMCG. I think obj_cgroup_memcg() is just not
defined in this case. Let's just return NULL here when !CONFIG_MEMCG.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-30  1:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-29 15:42 [akpm-mm:mm-unstable 179/192] mm/zswap.c:298:24: error: call to undeclared function 'obj_cgroup_memcg'; ISO C99 and later do not support implicit function declarations kernel test robot
2023-11-29 21:34 ` Andrew Morton
2023-11-30  1:53   ` Nhat Pham

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.