From: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org, ingo@redhat.com,
peterz@infradead.org, arnd@arndb.de, Waiman.Long@hpe.com,
will.deacon@arm.com, Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
Subject: Re: [PATCH] locking/qrwlock: Let qrwlock has same layout regardless of the endian
Date: Wed, 15 Jun 2016 17:46:32 +0800 [thread overview]
Message-ID: <201606151748.6jdOBvsB%fengguang.wu@intel.com> (raw)
In-Reply-To: <1465982177-2949-1-git-send-email-xinhui.pan@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 7751 bytes --]
Hi,
[auto build test ERROR on asm-generic/master]
[also build test ERROR on v4.7-rc3 next-20160615]
[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/Pan-Xinhui/locking-qrwlock-Let-qrwlock-has-same-layout-regardless-of-the-endian/20160615-172044
base: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic master
config: x86_64-randconfig-x014-201624 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
In file included from arch/x86/include/asm/qrwlock.h:5:0,
from arch/x86/include/asm/spinlock.h:219,
from include/linux/spinlock.h:87,
from include/linux/mmzone.h:7,
from include/linux/gfp.h:5,
from include/linux/slab.h:14,
from include/linux/crypto.h:24,
from arch/x86/kernel/asm-offsets.c:8:
include/asm-generic/qrwlock.h: In function 'queued_read_can_lock':
>> include/asm-generic/qrwlock.h:40:29: error: '_QW_SHIFT' undeclared (first use in this function)
#define _QW_WMASK (0xffU << _QW_SHIFT) /* Writer mask */
^
>> include/asm-generic/qrwlock.h:55:38: note: in expansion of macro '_QW_WMASK'
return !(atomic_read(&lock->cnts) & _QW_WMASK);
^~~~~~~~~
include/asm-generic/qrwlock.h:40:29: note: each undeclared identifier is reported only once for each function it appears in
#define _QW_WMASK (0xffU << _QW_SHIFT) /* Writer mask */
^
>> include/asm-generic/qrwlock.h:55:38: note: in expansion of macro '_QW_WMASK'
return !(atomic_read(&lock->cnts) & _QW_WMASK);
^~~~~~~~~
In file included from arch/x86/include/asm/atomic.h:4:0,
from include/linux/atomic.h:4,
from include/linux/crypto.h:20,
from arch/x86/kernel/asm-offsets.c:8:
include/asm-generic/qrwlock.h: In function 'queued_read_trylock':
>> include/asm-generic/qrwlock.h:40:29: error: '_QW_SHIFT' undeclared (first use in this function)
#define _QW_WMASK (0xffU << _QW_SHIFT) /* Writer mask */
^
include/linux/compiler.h:169:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
include/asm-generic/qrwlock.h:77:22: note: in expansion of macro '_QW_WMASK'
if (likely(!(cnts & _QW_WMASK))) {
^~~~~~~~~
include/asm-generic/qrwlock.h: In function 'queued_write_trylock':
include/asm-generic/qrwlock.h:39:30: error: '_QW_SHIFT' undeclared (first use in this function)
#define _QW_LOCKED (0xffU << _QW_SHIFT) /* A writer holds the lock */
^
include/linux/compiler.h:169:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
>> include/asm-generic/qrwlock.h:100:24: note: in expansion of macro '_QW_LOCKED'
cnts, cnts | _QW_LOCKED) == cnts);
^~~~~~~~~~
include/asm-generic/qrwlock.h: In function 'queued_read_lock':
>> include/asm-generic/qrwlock.h:40:29: error: '_QW_SHIFT' undeclared (first use in this function)
#define _QW_WMASK (0xffU << _QW_SHIFT) /* Writer mask */
^
include/linux/compiler.h:169:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
include/asm-generic/qrwlock.h:111:22: note: in expansion of macro '_QW_WMASK'
if (likely(!(cnts & _QW_WMASK)))
^~~~~~~~~
In file included from arch/x86/include/asm/qrwlock.h:5:0,
from arch/x86/include/asm/spinlock.h:219,
from include/linux/spinlock.h:87,
from include/linux/mmzone.h:7,
from include/linux/gfp.h:5,
from include/linux/slab.h:14,
from include/linux/crypto.h:24,
from arch/x86/kernel/asm-offsets.c:8:
include/asm-generic/qrwlock.h: In function 'queued_write_lock':
include/asm-generic/qrwlock.h:39:30: error: '_QW_SHIFT' undeclared (first use in this function)
#define _QW_LOCKED (0xffU << _QW_SHIFT) /* A writer holds the lock */
^
include/asm-generic/qrwlock.h:125:45: note: in expansion of macro '_QW_LOCKED'
if (atomic_cmpxchg_acquire(&lock->cnts, 0, _QW_LOCKED) == 0)
^~~~~~~~~~
make[2]: *** [arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [sub-make] Error 2
vim +/_QW_SHIFT +40 include/asm-generic/qrwlock.h
33 #else
34 #define _QR_SHIFT 0 /* Reader count shift */
35 #define _QW_SHIFT 24 /* Writer mode shift */
36 #endif
37
38 #define _QW_WAITING (1U << _QW_SHIFT) /* A writer is waiting */
> 39 #define _QW_LOCKED (0xffU << _QW_SHIFT) /* A writer holds the lock */
> 40 #define _QW_WMASK (0xffU << _QW_SHIFT) /* Writer mask */
41 #define _QR_BIAS (1U << _QR_SHIFT)
42
43 /*
44 * External function declarations
45 */
46 extern void queued_read_lock_slowpath(struct qrwlock *lock, u32 cnts);
47 extern void queued_write_lock_slowpath(struct qrwlock *lock);
48
49 /**
50 * queued_read_can_lock- would read_trylock() succeed?
51 * @lock: Pointer to queue rwlock structure
52 */
53 static inline int queued_read_can_lock(struct qrwlock *lock)
54 {
> 55 return !(atomic_read(&lock->cnts) & _QW_WMASK);
56 }
57
58 /**
59 * queued_write_can_lock- would write_trylock() succeed?
60 * @lock: Pointer to queue rwlock structure
61 */
62 static inline int queued_write_can_lock(struct qrwlock *lock)
63 {
64 return !atomic_read(&lock->cnts);
65 }
66
67 /**
68 * queued_read_trylock - try to acquire read lock of a queue rwlock
69 * @lock : Pointer to queue rwlock structure
70 * Return: 1 if lock acquired, 0 if failed
71 */
72 static inline int queued_read_trylock(struct qrwlock *lock)
73 {
74 u32 cnts;
75
76 cnts = atomic_read(&lock->cnts);
77 if (likely(!(cnts & _QW_WMASK))) {
78 cnts = (u32)atomic_add_return_acquire(_QR_BIAS, &lock->cnts);
79 if (likely(!(cnts & _QW_WMASK)))
80 return 1;
81 atomic_sub(_QR_BIAS, &lock->cnts);
82 }
83 return 0;
84 }
85
86 /**
87 * queued_write_trylock - try to acquire write lock of a queue rwlock
88 * @lock : Pointer to queue rwlock structure
89 * Return: 1 if lock acquired, 0 if failed
90 */
91 static inline int queued_write_trylock(struct qrwlock *lock)
92 {
93 u32 cnts;
94
95 cnts = atomic_read(&lock->cnts);
96 if (unlikely(cnts))
97 return 0;
98
99 return likely(atomic_cmpxchg_acquire(&lock->cnts,
> 100 cnts, cnts | _QW_LOCKED) == cnts);
101 }
102 /**
103 * queued_read_lock - acquire read lock of a queue rwlock
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 28173 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org, ingo@redhat.com,
peterz@infradead.org, arnd@arndb.de, Waiman.Long@hpe.com,
will.deacon@arm.com
Subject: Re: [PATCH] locking/qrwlock: Let qrwlock has same layout regardless of the endian
Date: Wed, 15 Jun 2016 17:46:32 +0800 [thread overview]
Message-ID: <201606151748.6jdOBvsB%fengguang.wu@intel.com> (raw)
Message-ID: <20160615094632.J70c_kcEYPA2F7HnUrHZFAxe6M5JXGbCLcY05h4hzQk@z> (raw)
In-Reply-To: <1465982177-2949-1-git-send-email-xinhui.pan@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 7751 bytes --]
Hi,
[auto build test ERROR on asm-generic/master]
[also build test ERROR on v4.7-rc3 next-20160615]
[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/Pan-Xinhui/locking-qrwlock-Let-qrwlock-has-same-layout-regardless-of-the-endian/20160615-172044
base: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic master
config: x86_64-randconfig-x014-201624 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
In file included from arch/x86/include/asm/qrwlock.h:5:0,
from arch/x86/include/asm/spinlock.h:219,
from include/linux/spinlock.h:87,
from include/linux/mmzone.h:7,
from include/linux/gfp.h:5,
from include/linux/slab.h:14,
from include/linux/crypto.h:24,
from arch/x86/kernel/asm-offsets.c:8:
include/asm-generic/qrwlock.h: In function 'queued_read_can_lock':
>> include/asm-generic/qrwlock.h:40:29: error: '_QW_SHIFT' undeclared (first use in this function)
#define _QW_WMASK (0xffU << _QW_SHIFT) /* Writer mask */
^
>> include/asm-generic/qrwlock.h:55:38: note: in expansion of macro '_QW_WMASK'
return !(atomic_read(&lock->cnts) & _QW_WMASK);
^~~~~~~~~
include/asm-generic/qrwlock.h:40:29: note: each undeclared identifier is reported only once for each function it appears in
#define _QW_WMASK (0xffU << _QW_SHIFT) /* Writer mask */
^
>> include/asm-generic/qrwlock.h:55:38: note: in expansion of macro '_QW_WMASK'
return !(atomic_read(&lock->cnts) & _QW_WMASK);
^~~~~~~~~
In file included from arch/x86/include/asm/atomic.h:4:0,
from include/linux/atomic.h:4,
from include/linux/crypto.h:20,
from arch/x86/kernel/asm-offsets.c:8:
include/asm-generic/qrwlock.h: In function 'queued_read_trylock':
>> include/asm-generic/qrwlock.h:40:29: error: '_QW_SHIFT' undeclared (first use in this function)
#define _QW_WMASK (0xffU << _QW_SHIFT) /* Writer mask */
^
include/linux/compiler.h:169:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
include/asm-generic/qrwlock.h:77:22: note: in expansion of macro '_QW_WMASK'
if (likely(!(cnts & _QW_WMASK))) {
^~~~~~~~~
include/asm-generic/qrwlock.h: In function 'queued_write_trylock':
include/asm-generic/qrwlock.h:39:30: error: '_QW_SHIFT' undeclared (first use in this function)
#define _QW_LOCKED (0xffU << _QW_SHIFT) /* A writer holds the lock */
^
include/linux/compiler.h:169:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
>> include/asm-generic/qrwlock.h:100:24: note: in expansion of macro '_QW_LOCKED'
cnts, cnts | _QW_LOCKED) == cnts);
^~~~~~~~~~
include/asm-generic/qrwlock.h: In function 'queued_read_lock':
>> include/asm-generic/qrwlock.h:40:29: error: '_QW_SHIFT' undeclared (first use in this function)
#define _QW_WMASK (0xffU << _QW_SHIFT) /* Writer mask */
^
include/linux/compiler.h:169:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
include/asm-generic/qrwlock.h:111:22: note: in expansion of macro '_QW_WMASK'
if (likely(!(cnts & _QW_WMASK)))
^~~~~~~~~
In file included from arch/x86/include/asm/qrwlock.h:5:0,
from arch/x86/include/asm/spinlock.h:219,
from include/linux/spinlock.h:87,
from include/linux/mmzone.h:7,
from include/linux/gfp.h:5,
from include/linux/slab.h:14,
from include/linux/crypto.h:24,
from arch/x86/kernel/asm-offsets.c:8:
include/asm-generic/qrwlock.h: In function 'queued_write_lock':
include/asm-generic/qrwlock.h:39:30: error: '_QW_SHIFT' undeclared (first use in this function)
#define _QW_LOCKED (0xffU << _QW_SHIFT) /* A writer holds the lock */
^
include/asm-generic/qrwlock.h:125:45: note: in expansion of macro '_QW_LOCKED'
if (atomic_cmpxchg_acquire(&lock->cnts, 0, _QW_LOCKED) == 0)
^~~~~~~~~~
make[2]: *** [arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [sub-make] Error 2
vim +/_QW_SHIFT +40 include/asm-generic/qrwlock.h
33 #else
34 #define _QR_SHIFT 0 /* Reader count shift */
35 #define _QW_SHIFT 24 /* Writer mode shift */
36 #endif
37
38 #define _QW_WAITING (1U << _QW_SHIFT) /* A writer is waiting */
> 39 #define _QW_LOCKED (0xffU << _QW_SHIFT) /* A writer holds the lock */
> 40 #define _QW_WMASK (0xffU << _QW_SHIFT) /* Writer mask */
41 #define _QR_BIAS (1U << _QR_SHIFT)
42
43 /*
44 * External function declarations
45 */
46 extern void queued_read_lock_slowpath(struct qrwlock *lock, u32 cnts);
47 extern void queued_write_lock_slowpath(struct qrwlock *lock);
48
49 /**
50 * queued_read_can_lock- would read_trylock() succeed?
51 * @lock: Pointer to queue rwlock structure
52 */
53 static inline int queued_read_can_lock(struct qrwlock *lock)
54 {
> 55 return !(atomic_read(&lock->cnts) & _QW_WMASK);
56 }
57
58 /**
59 * queued_write_can_lock- would write_trylock() succeed?
60 * @lock: Pointer to queue rwlock structure
61 */
62 static inline int queued_write_can_lock(struct qrwlock *lock)
63 {
64 return !atomic_read(&lock->cnts);
65 }
66
67 /**
68 * queued_read_trylock - try to acquire read lock of a queue rwlock
69 * @lock : Pointer to queue rwlock structure
70 * Return: 1 if lock acquired, 0 if failed
71 */
72 static inline int queued_read_trylock(struct qrwlock *lock)
73 {
74 u32 cnts;
75
76 cnts = atomic_read(&lock->cnts);
77 if (likely(!(cnts & _QW_WMASK))) {
78 cnts = (u32)atomic_add_return_acquire(_QR_BIAS, &lock->cnts);
79 if (likely(!(cnts & _QW_WMASK)))
80 return 1;
81 atomic_sub(_QR_BIAS, &lock->cnts);
82 }
83 return 0;
84 }
85
86 /**
87 * queued_write_trylock - try to acquire write lock of a queue rwlock
88 * @lock : Pointer to queue rwlock structure
89 * Return: 1 if lock acquired, 0 if failed
90 */
91 static inline int queued_write_trylock(struct qrwlock *lock)
92 {
93 u32 cnts;
94
95 cnts = atomic_read(&lock->cnts);
96 if (unlikely(cnts))
97 return 0;
98
99 return likely(atomic_cmpxchg_acquire(&lock->cnts,
> 100 cnts, cnts | _QW_LOCKED) == cnts);
101 }
102 /**
103 * queued_read_lock - acquire read lock of a queue rwlock
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 28173 bytes --]
next prev parent reply other threads:[~2016-06-15 9:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 9:16 [PATCH] locking/qrwlock: Let qrwlock has same layout regardless of the endian Pan Xinhui
2016-06-15 9:16 ` Pan Xinhui
2016-06-15 9:20 ` Will Deacon
2016-06-15 9:28 ` xinhui
2016-06-15 9:28 ` xinhui
2016-06-15 9:46 ` kbuild test robot [this message]
2016-06-15 9:46 ` kbuild test robot
2016-06-15 9:49 ` kbuild test robot
2016-06-15 9:49 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201606151748.6jdOBvsB%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=Waiman.Long@hpe.com \
--cc=arnd@arndb.de \
--cc=ingo@redhat.com \
--cc=kbuild-all@01.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=will.deacon@arm.com \
--cc=xinhui.pan@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox