lkml.org 
[lkml]   [2020]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[tip:locking/core 10/30] include/linux/ww_mutex.h:132:14: error: 'current' undeclared; did you mean
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
head: b5e6a027bd327daa679ca55182a920659e2cbb90
commit: 55f3560df975f557c48aa6afc636808f31ecb87a [10/30] seqlock: Extend seqcount API with associated locks
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
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
git checkout 55f3560df975f557c48aa6afc636808f31ecb87a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc

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

All errors (new ones prefixed by >>):

In file included from include/linux/seqlock.h:22,
from include/linux/time.h:6,
from arch/sparc/vdso/vdso32/../vclock_gettime.c:16,
from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
include/linux/ww_mutex.h: In function 'ww_acquire_init':
>> include/linux/ww_mutex.h:132:14: error: 'current' undeclared (first use in this function); did you mean 'current_set'?
132 | ctx->task = current;
| ^~~~~~~
| current_set
include/linux/ww_mutex.h:132:14: note: each undeclared identifier is reported only once for each function it appears in
In file included from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
arch/sparc/vdso/vdso32/../vclock_gettime.c: At top level:
arch/sparc/vdso/vdso32/../vclock_gettime.c:254:1: warning: no previous prototype for '__vdso_clock_gettime' [-Wmissing-prototypes]
254 | __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
| ^~~~~~~~~~~~~~~~~~~~
arch/sparc/vdso/vdso32/../vclock_gettime.c:282:1: warning: no previous prototype for '__vdso_clock_gettime_stick' [-Wmissing-prototypes]
282 | __vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *ts)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/vdso/vdso32/../vclock_gettime.c:307:1: warning: no previous prototype for '__vdso_gettimeofday' [-Wmissing-prototypes]
307 | __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
| ^~~~~~~~~~~~~~~~~~~
arch/sparc/vdso/vdso32/../vclock_gettime.c:343:1: warning: no previous prototype for '__vdso_gettimeofday_stick' [-Wmissing-prototypes]
343 | __vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz)
| ^~~~~~~~~~~~~~~~~~~~~~~~~

vim +132 include/linux/ww_mutex.h

1b375dc3071018 Maarten Lankhorst 2013-07-05 104
1b375dc3071018 Maarten Lankhorst 2013-07-05 105 /**
1b375dc3071018 Maarten Lankhorst 2013-07-05 106 * ww_acquire_init - initialize a w/w acquire context
1b375dc3071018 Maarten Lankhorst 2013-07-05 107 * @ctx: w/w acquire context to initialize
1b375dc3071018 Maarten Lankhorst 2013-07-05 108 * @ww_class: w/w class of the context
1b375dc3071018 Maarten Lankhorst 2013-07-05 109 *
1b375dc3071018 Maarten Lankhorst 2013-07-05 110 * Initializes an context to acquire multiple mutexes of the given w/w class.
1b375dc3071018 Maarten Lankhorst 2013-07-05 111 *
1b375dc3071018 Maarten Lankhorst 2013-07-05 112 * Context-based w/w mutex acquiring can be done in any order whatsoever within
1b375dc3071018 Maarten Lankhorst 2013-07-05 113 * a given lock class. Deadlocks will be detected and handled with the
55f036ca7e74b8 Peter Ziljstra 2018-06-15 114 * wait/die logic.
1b375dc3071018 Maarten Lankhorst 2013-07-05 115 *
1b375dc3071018 Maarten Lankhorst 2013-07-05 116 * Mixing of context-based w/w mutex acquiring and single w/w mutex locking can
1b375dc3071018 Maarten Lankhorst 2013-07-05 117 * result in undetected deadlocks and is so forbidden. Mixing different contexts
1b375dc3071018 Maarten Lankhorst 2013-07-05 118 * for the same w/w class when acquiring mutexes can also result in undetected
1b375dc3071018 Maarten Lankhorst 2013-07-05 119 * deadlocks, and is hence also forbidden. Both types of abuse will be caught by
1b375dc3071018 Maarten Lankhorst 2013-07-05 120 * enabling CONFIG_PROVE_LOCKING.
1b375dc3071018 Maarten Lankhorst 2013-07-05 121 *
1b375dc3071018 Maarten Lankhorst 2013-07-05 122 * Nesting of acquire contexts for _different_ w/w classes is possible, subject
1b375dc3071018 Maarten Lankhorst 2013-07-05 123 * to the usual locking rules between different lock classes.
1b375dc3071018 Maarten Lankhorst 2013-07-05 124 *
1b375dc3071018 Maarten Lankhorst 2013-07-05 125 * An acquire context must be released with ww_acquire_fini by the same task
1b375dc3071018 Maarten Lankhorst 2013-07-05 126 * before the memory is freed. It is recommended to allocate the context itself
1b375dc3071018 Maarten Lankhorst 2013-07-05 127 * on the stack.
1b375dc3071018 Maarten Lankhorst 2013-07-05 128 */
1b375dc3071018 Maarten Lankhorst 2013-07-05 129 static inline void ww_acquire_init(struct ww_acquire_ctx *ctx,
1b375dc3071018 Maarten Lankhorst 2013-07-05 130 struct ww_class *ww_class)
1b375dc3071018 Maarten Lankhorst 2013-07-05 131 {
1b375dc3071018 Maarten Lankhorst 2013-07-05 @132 ctx->task = current;
f4ec57b632fe15 Peter Zijlstra 2016-11-24 133 ctx->stamp = atomic_long_inc_return_relaxed(&ww_class->stamp);
1b375dc3071018 Maarten Lankhorst 2013-07-05 134 ctx->acquired = 0;
08295b3b5beec9 Thomas Hellstrom 2018-06-15 135 ctx->wounded = false;
08295b3b5beec9 Thomas Hellstrom 2018-06-15 136 ctx->is_wait_die = ww_class->is_wait_die;
1b375dc3071018 Maarten Lankhorst 2013-07-05 137 #ifdef CONFIG_DEBUG_MUTEXES
1b375dc3071018 Maarten Lankhorst 2013-07-05 138 ctx->ww_class = ww_class;
1b375dc3071018 Maarten Lankhorst 2013-07-05 139 ctx->done_acquire = 0;
1b375dc3071018 Maarten Lankhorst 2013-07-05 140 ctx->contending_lock = NULL;
1b375dc3071018 Maarten Lankhorst 2013-07-05 141 #endif
1b375dc3071018 Maarten Lankhorst 2013-07-05 142 #ifdef CONFIG_DEBUG_LOCK_ALLOC
1b375dc3071018 Maarten Lankhorst 2013-07-05 143 debug_check_no_locks_freed((void *)ctx, sizeof(*ctx));
1b375dc3071018 Maarten Lankhorst 2013-07-05 144 lockdep_init_map(&ctx->dep_map, ww_class->acquire_name,
1b375dc3071018 Maarten Lankhorst 2013-07-05 145 &ww_class->acquire_key, 0);
1b375dc3071018 Maarten Lankhorst 2013-07-05 146 mutex_acquire(&ctx->dep_map, 0, 0, _RET_IP_);
1b375dc3071018 Maarten Lankhorst 2013-07-05 147 #endif
1b375dc3071018 Maarten Lankhorst 2013-07-05 148 #ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH
1b375dc3071018 Maarten Lankhorst 2013-07-05 149 ctx->deadlock_inject_interval = 1;
1b375dc3071018 Maarten Lankhorst 2013-07-05 150 ctx->deadlock_inject_countdown = ctx->stamp & 0xf;
1b375dc3071018 Maarten Lankhorst 2013-07-05 151 #endif
1b375dc3071018 Maarten Lankhorst 2013-07-05 152 }
1b375dc3071018 Maarten Lankhorst 2013-07-05 153

:::::: The code at line 132 was first introduced by commit
:::::: 1b375dc30710180c4b88cc59caba6e3481ec5c8b mutex: Move ww_mutex definitions to ww_mutex.h

:::::: TO: Maarten Lankhorst <maarten.lankhorst@canonical.com>
:::::: CC: Ingo Molnar <mingo@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2020-07-30 20:43    [W:0.563 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site