Re: [PATCH 3/3] lockdep: new annotation lock_downgrade()

From: Peter Zijlstra
Date: Thu Feb 02 2017 - 13:45:52 EST


On Fri, Feb 03, 2017 at 01:59:37AM +0800, kbuild test robot wrote:
> Hi Okajima,
>
> [auto build test ERROR on tip/locking/core]
> [also build test ERROR on v4.10-rc6 next-20170202]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url: https://github.com/0day-ci/linux/commits/J-R-Okajima/lockdep-consolidate-by-new-find_held_lock/20170203-010303
> config: x86_64-randconfig-x018-201705 (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> All errors (new ones prefixed by >>):
>
> kernel/locking/rwsem.c: In function 'downgrade_write':
> >> kernel/locking/rwsem.c:126:2: error: implicit declaration of function 'lock_downgrade' [-Werror=implicit-function-declaration]
> lock_downgrade(&sem->dep_map, _RET_IP_);
> ^~~~~~~~~~~~~~
> >> kernel/locking/rwsem.c:126:21: error: 'struct rw_semaphore' has no member named 'dep_map'
> lock_downgrade(&sem->dep_map, _RET_IP_);
> ^~
> cc1: some warnings being treated as errors
>
> vim +/lock_downgrade +126 kernel/locking/rwsem.c
>
> 120
> 121 /*
> 122 * downgrade write lock to read lock
> 123 */
> 124 void downgrade_write(struct rw_semaphore *sem)
> 125 {
> > 126 lock_downgrade(&sem->dep_map, _RET_IP_);
> 127
> 128 rwsem_set_reader_owned(sem);
> 129 __downgrade_write(sem);

This is what you need !LOCKDEP stubs for ;-)