lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 22 Oct 2022 07:13:16 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jiri Kosina <jikos@...nel.org>,
        Christoph Lameter <cl@...ux-foundation.org>,
        Pekka Enberg <penberg@...nel.org>,
        David Rientjes <rientjes@...gle.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        Roman Gushchin <roman.gushchin@...ux.dev>,
        Hyeonggon Yoo <42.hyeyoo@...il.com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        Linux Memory Management List <linux-mm@...ck.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/slab: Annotate kmem_cache_node->list_lock as raw

Hi Jiri,

I love your patch! Yet something to improve:

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

url:    https://github.com/intel-lab-lkp/linux/commits/Jiri-Kosina/mm-slab-Annotate-kmem_cache_node-list_lock-as-raw/20221021-225037
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/nycvar.YFH.7.76.2210211643330.29912%40cbobk.fhfr.pm
patch subject: [PATCH] mm/slab: Annotate kmem_cache_node->list_lock as raw
config: mips-bcm63xx_defconfig
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
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
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/709b8ca6934319e9e8e0519baa3ac2bb4f634451
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Jiri-Kosina/mm-slab-Annotate-kmem_cache_node-list_lock-as-raw/20221021-225037
        git checkout 709b8ca6934319e9e8e0519baa3ac2bb4f634451
        # 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=mips SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

                                                                     ^
   mm/slub.c:2508:27: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
                           spin_unlock_irqrestore(&n->list_lock, flags);
                                                  ^~~~~~~~~~~~~
   include/linux/spinlock.h:403:64: note: passing argument to parameter 'lock' here
   static __always_inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
                                                                  ^
   mm/slub.c:2515:26: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
                   spin_unlock_irqrestore(&n->list_lock, flags);
                                          ^~~~~~~~~~~~~
   include/linux/spinlock.h:403:64: note: passing argument to parameter 'lock' here
   static __always_inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
                                                                  ^
   mm/slub.c:2523:26: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
                   spin_unlock_irqrestore(&n->list_lock, flags);
                                          ^~~~~~~~~~~~~
   include/linux/spinlock.h:403:64: note: passing argument to parameter 'lock' here
   static __always_inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
                                                                  ^
   mm/slub.c:2946:20: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
           spin_lock_irqsave(&n->list_lock, flags);
                             ^~~~~~~~~~~~~
   include/linux/spinlock.h:380:39: note: expanded from macro 'spin_lock_irqsave'
           raw_spin_lock_irqsave(spinlock_check(lock), flags);     \
                                                ^~~~
   include/linux/spinlock.h:265:26: note: expanded from macro 'raw_spin_lock_irqsave'
                   _raw_spin_lock_irqsave(lock, flags);    \
                                          ^~~~
   include/linux/spinlock_api_up.h:69:60: note: expanded from macro '_raw_spin_lock_irqsave'
   #define _raw_spin_lock_irqsave(lock, flags)     __LOCK_IRQSAVE(lock, flags)
                                                                  ^~~~
   include/linux/spinlock_api_up.h:40:38: note: expanded from macro '__LOCK_IRQSAVE'
     do { local_irq_save(flags); __LOCK(lock); } while (0)
                                        ^~~~
   include/linux/spinlock_api_up.h:31:35: note: expanded from macro '__LOCK'
     do { preempt_disable(); ___LOCK(lock); } while (0)
                                     ^~~~
   include/linux/spinlock_api_up.h:28:32: note: expanded from macro '___LOCK'
     do { __acquire(lock); (void)(lock); } while (0)
                                  ^~~~
   include/linux/spinlock.h:323:67: note: passing argument to parameter 'lock' here
   static __always_inline raw_spinlock_t *spinlock_check(spinlock_t *lock)
                                                                     ^
   mm/slub.c:2949:25: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
           spin_unlock_irqrestore(&n->list_lock, flags);
                                  ^~~~~~~~~~~~~
   include/linux/spinlock.h:403:64: note: passing argument to parameter 'lock' here
   static __always_inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
                                                                  ^
   mm/slub.c:3483:27: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
                           spin_unlock_irqrestore(&n->list_lock, flags);
                                                  ^~~~~~~~~~~~~
   include/linux/spinlock.h:403:64: note: passing argument to parameter 'lock' here
   static __always_inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
                                                                  ^
   mm/slub.c:3515:23: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
                                   spin_lock_irqsave(&n->list_lock, flags);
                                                     ^~~~~~~~~~~~~
   include/linux/spinlock.h:380:39: note: expanded from macro 'spin_lock_irqsave'
           raw_spin_lock_irqsave(spinlock_check(lock), flags);     \
                                                ^~~~
   include/linux/spinlock.h:265:26: note: expanded from macro 'raw_spin_lock_irqsave'
                   _raw_spin_lock_irqsave(lock, flags);    \
                                          ^~~~
   include/linux/spinlock_api_up.h:69:60: note: expanded from macro '_raw_spin_lock_irqsave'
   #define _raw_spin_lock_irqsave(lock, flags)     __LOCK_IRQSAVE(lock, flags)
                                                                  ^~~~
   include/linux/spinlock_api_up.h:40:38: note: expanded from macro '__LOCK_IRQSAVE'
     do { local_irq_save(flags); __LOCK(lock); } while (0)
                                        ^~~~
   include/linux/spinlock_api_up.h:31:35: note: expanded from macro '__LOCK'
     do { preempt_disable(); ___LOCK(lock); } while (0)
                                     ^~~~
   include/linux/spinlock_api_up.h:28:32: note: expanded from macro '___LOCK'
     do { __acquire(lock); (void)(lock); } while (0)
                                  ^~~~
   include/linux/spinlock.h:323:67: note: passing argument to parameter 'lock' here
   static __always_inline raw_spinlock_t *spinlock_check(spinlock_t *lock)
                                                                     ^
   mm/slub.c:3557:25: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
           spin_unlock_irqrestore(&n->list_lock, flags);
                                  ^~~~~~~~~~~~~
   include/linux/spinlock.h:403:64: note: passing argument to parameter 'lock' here
   static __always_inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
                                                                  ^
   mm/slub.c:3572:25: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
           spin_unlock_irqrestore(&n->list_lock, flags);
                                  ^~~~~~~~~~~~~
   include/linux/spinlock.h:403:64: note: passing argument to parameter 'lock' here
   static __always_inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
                                                                  ^
   mm/slub.c:4008:17: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
           spin_lock_init(&n->list_lock);
                          ^~~~~~~~~~~~~
   include/linux/spinlock.h:342:17: note: expanded from macro 'spin_lock_init'
           spinlock_check(_lock);                  \
                          ^~~~~
   include/linux/spinlock.h:323:67: note: passing argument to parameter 'lock' here
   static __always_inline raw_spinlock_t *spinlock_check(spinlock_t *lock)
                                                                     ^
>> mm/slub.c:4008:2: error: assigning to 'raw_spinlock_t' (aka 'struct raw_spinlock') from incompatible type 'spinlock_t' (aka 'struct spinlock')
           spin_lock_init(&n->list_lock);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/spinlock.h:343:11: note: expanded from macro 'spin_lock_init'
           *(_lock) = __SPIN_LOCK_UNLOCKED(_lock); \
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/slub.c:4393:16: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
           spin_lock_irq(&n->list_lock);
                         ^~~~~~~~~~~~~
   include/linux/spinlock.h:373:55: note: passing argument to parameter 'lock' here
   static __always_inline void spin_lock_irq(spinlock_t *lock)
                                                         ^
   mm/slub.c:4403:18: error: incompatible pointer types passing 'raw_spinlock_t *' (aka 'struct raw_spinlock *') to parameter of type 'spinlock_t *' (aka 'struct spinlock *') [-Werror,-Wincompatible-pointer-types]
           spin_unlock_irq(&n->list_lock);
                           ^~~~~~~~~~~~~
   include/linux/spinlock.h:398:57: note: passing argument to parameter 'lock' here
   static __always_inline void spin_unlock_irq(spinlock_t *lock)
                                                           ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   1 warning and 20 errors generated.


vim +4008 mm/slub.c

81819f0fc8285a Christoph Lameter 2007-05-06  4003  
5595cffc8248e4 Pekka Enberg      2008-08-05  4004  static void
4053497d6a3771 Joonsoo Kim       2012-05-11  4005  init_kmem_cache_node(struct kmem_cache_node *n)
81819f0fc8285a Christoph Lameter 2007-05-06  4006  {
81819f0fc8285a Christoph Lameter 2007-05-06  4007  	n->nr_partial = 0;
81819f0fc8285a Christoph Lameter 2007-05-06 @4008  	spin_lock_init(&n->list_lock);
81819f0fc8285a Christoph Lameter 2007-05-06  4009  	INIT_LIST_HEAD(&n->partial);
8ab1372fac5684 Christoph Lameter 2007-07-17  4010  #ifdef CONFIG_SLUB_DEBUG
0f389ec6307752 Christoph Lameter 2008-04-14  4011  	atomic_long_set(&n->nr_slabs, 0);
02b71b70129aaa Salman Qazi       2008-09-11  4012  	atomic_long_set(&n->total_objects, 0);
643b113849d8fa Christoph Lameter 2007-05-06  4013  	INIT_LIST_HEAD(&n->full);
8ab1372fac5684 Christoph Lameter 2007-07-17  4014  #endif
81819f0fc8285a Christoph Lameter 2007-05-06  4015  }
81819f0fc8285a Christoph Lameter 2007-05-06  4016  

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

View attachment "config" of type "text/plain" (62137 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ