* [peterz-queue:locking/core 10/18] kernel/locking/osq_lock.c:78:7: error: implicit declaration of function 'data_race'
@ 2020-02-07 19:40 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-02-07 19:40 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3213 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/core
head: 3632aa63d7b6bf773a5ba00e06415a144ffd25d1
commit: 6bf619166f87b59e2bffc68f34f2b2056bb2483c [10/18] locking/osq_lock: mark an intentional data race
config: arc-defconfig (attached as .config)
compiler: arc-elf-gcc (GCC) 9.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 6bf619166f87b59e2bffc68f34f2b2056bb2483c
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
kernel/locking/osq_lock.c: In function 'osq_wait_next':
>> kernel/locking/osq_lock.c:78:7: error: implicit declaration of function 'data_race' [-Werror=implicit-function-declaration]
78 | if (data_race(node->next)) {
| ^~~~~~~~~
cc1: some warnings being treated as errors
vim +/data_race +78 kernel/locking/osq_lock.c
36
37 /*
38 * Get a stable @node->next pointer, either for unlock() or unqueue() purposes.
39 * Can return NULL in case we were the last queued and we updated @lock instead.
40 */
41 static inline struct optimistic_spin_node *
42 osq_wait_next(struct optimistic_spin_queue *lock,
43 struct optimistic_spin_node *node,
44 struct optimistic_spin_node *prev)
45 {
46 struct optimistic_spin_node *next = NULL;
47 int curr = encode_cpu(smp_processor_id());
48 int old;
49
50 /*
51 * If there is a prev node in queue, then the 'old' value will be
52 * the prev node's CPU #, else it's set to OSQ_UNLOCKED_VAL since if
53 * we're currently last in queue, then the queue will then become empty.
54 */
55 old = prev ? prev->cpu : OSQ_UNLOCKED_VAL;
56
57 for (;;) {
58 if (atomic_read(&lock->tail) == curr &&
59 atomic_cmpxchg_acquire(&lock->tail, curr, old) == curr) {
60 /*
61 * We were the last queued, we moved @lock back. @prev
62 * will now observe @lock and will complete its
63 * unlock()/unqueue().
64 */
65 break;
66 }
67
68 /*
69 * We must xchg() the @node->next value, because if we were to
70 * leave it in, a concurrent unlock()/unqueue() from
71 * @node->next might complete Step-A and think its @prev is
72 * still valid.
73 *
74 * If the concurrent unlock()/unqueue() wins the race, we'll
75 * wait for either @lock to point to us, through its Step-B, or
76 * wait for a new @node->next from its Step-C.
77 */
> 78 if (data_race(node->next)) {
79 next = xchg(&node->next, NULL);
80 if (next)
81 break;
82 }
83
84 cpu_relax();
85 }
86
87 return next;
88 }
89
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 9129 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-02-07 19:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07 19:40 [peterz-queue:locking/core 10/18] kernel/locking/osq_lock.c:78:7: error: implicit declaration of function 'data_race' kbuild test robot
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.