Re: [kbuild-all] [lkp] [PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
On Tue, Oct 13, 2015 at 12:02:00AM +0800, Fengguang Wu wrote: > On Mon, Oct 12, 2015 at 11:42:24PM +0800, Boqun Feng wrote: > > Hi Fengguang, > > > > On Mon, Oct 12, 2015 at 11:29:14PM +0800, Fengguang Wu wrote: > > > Hi Boqun, > > > > > > The base tree detection is based on the whole patchset's > > > > > > - subjects > > > - touched files > > > - TO/CC list > > > > > > Log shows the files and TO/CC are strongly related to powerpc, > > > so it looks a natural choice to apply to it. Especially you put > > > "linuxppc-...@lists.ozlabs.org" in the TO list while Peter/Ingo > > > in the CC list -- that looks like a strong indication for powerpc. > > > > > > > Thank you for your explanation, so how about modifying the title to: > > > > [PATCH v3 tip/locking/core 2/6] ... > > > > also works? > > Yes it will work -- that'd be the most strong hint. > Great! I will use that hint in the future, thank you ;-) > > BTW, does this bot have more tests than 0day? I have pushed this > > patchset to my own repo and had it tested by 0day. > > Yes, it runs git am, the resulted commits are feed to 0day for > build/boot/performance tests. If you've already pushed the patches via > git, the robot should have skip such duplicate tests on the emailed > patches -- unless there is a bug. I'll have a check. > Thank you, so I'm not going to resend this v3 patchset, will use the subject hint for any future patchset ;-) Regards, Boqun signature.asc Description: PGP signature
Re: [kbuild-all] [lkp] [PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
> > BTW, does this bot have more tests than 0day? I have pushed this > > patchset to my own repo and had it tested by 0day. > > Yes, it runs git am, the resulted commits are feed to 0day for > build/boot/performance tests. If you've already pushed the patches via > git, the robot should have skip such duplicate tests on the emailed > patches -- unless there is a bug. I'll have a check. Ah yes, there is a silly bug.. Fixed, thanks! Fengguang -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [kbuild-all] [lkp] [PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
On Mon, Oct 12, 2015 at 11:42:24PM +0800, Boqun Feng wrote: > Hi Fengguang, > > On Mon, Oct 12, 2015 at 11:29:14PM +0800, Fengguang Wu wrote: > > Hi Boqun, > > > > The base tree detection is based on the whole patchset's > > > > - subjects > > - touched files > > - TO/CC list > > > > Log shows the files and TO/CC are strongly related to powerpc, > > so it looks a natural choice to apply to it. Especially you put > > "linuxppc-...@lists.ozlabs.org" in the TO list while Peter/Ingo > > in the CC list -- that looks like a strong indication for powerpc. > > > > Thank you for your explanation, so how about modifying the title to: > > [PATCH v3 tip/locking/core 2/6] ... > > also works? Yes it will work -- that'd be the most strong hint. > BTW, does this bot have more tests than 0day? I have pushed this > patchset to my own repo and had it tested by 0day. Yes, it runs git am, the resulted commits are feed to 0day for build/boot/performance tests. If you've already pushed the patches via git, the robot should have skip such duplicate tests on the emailed patches -- unless there is a bug. I'll have a check. Thanks, Fengguang > > [2015-10-12 22:27:49] patched_files: ["arch/powerpc/include/asm/cmpxchg.h", > > "lib/atomic64_test.c", "include/linux/atomic.h", > > "arch/powerpc/include/asm/atomic.h"] > > [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next"] > > > > [2015-10-12 22:27:49] lists: ["linux-kernel@vger.kernel.org", > > "linuxppc-...@lists.ozlabs.org", "Peter Zijlstra ", > > "Ingo Molnar " > > , "Benjamin Herrenschmidt ", "Paul Mackerras > > ", "Michael Ellerman ", "Thomas > > Gleixner > e>", "Will Deacon ", "\"Paul E. McKenney\" > > ", "Waiman Long ", > > "Davidlohr Bueso " > > , "Boqun Feng "] > > [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next", > > "powerpc/next", "mpe/next", "mpe/next", "arm64/for-next/core", > > "arm64/for-next/core"] > > > > The possible improvement would be to let tip:locking/core register > > itself in the MAINTAINERS file to match files *cmpxchg* *atomic*. > > > > Thanks, > > Fengguang > > > > On Mon, Oct 12, 2015 at 10:56:52PM +0800, Boqun Feng wrote: > > > On Mon, Oct 12, 2015 at 10:43:56PM +0800, kbuild test robot wrote: > > > > Hi Boqun, > > > > > > > > [auto build test ERROR on v4.3-rc5 -- if it's inappropriate base, > > > > please suggest rules for selecting the more suitable base] > > > > > > > > > > This patch should be tested based on current locking/core branch of tip > > > tree. Thank you. > > > > > > Regards, > > > Boqun > > > > > > > url: > > > > https://github.com/0day-ci/linux/commits/Boqun-Feng/atomics-powerpc-Implement-relaxed-acquire-release-variants-of-some-atomics/20151012-222750 > > > > config: x86_64-randconfig-x016-10121751 (attached as .config) > > > > reproduce: > > > > # save the attached .config to linux build tree > > > > make ARCH=x86_64 > > > > > > > > All error/warnings (new ones prefixed by >>): > > > > > > > >In file included from include/linux/init.h:4:0, > > > > from lib/atomic64_test.c:14: > > > >lib/atomic64_test.c: In function 'test_atomic': > > > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > > > >> 'atomic_inc_return_acquire' [-Werror=implicit-function-declaration] > > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > > ^ > > > >include/linux/compiler.h:166:42: note: in definition of macro > > > > 'unlikely' > > > > # define unlikely(x) __builtin_expect(!!(x), 0) > > > > ^ > > > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > > ^ > > > > >> lib/atomic64_test.c:38:2: note: in expansion of macro 'TEST_ARGS' > > > > test(bit, op##_acquire, ##args); \ > > > > ^ > > > > >> lib/atomic64_test.c:79:2: note: in expansion of macro 'FAMILY_TEST' > > > > FAMILY_TEST(TEST_ARGS, bit, inc_return, \ > > > > ^ > > > > >> lib/atomic64_test.c:113:2: note: in expansion of macro > > > > >> 'INC_RETURN_FAMILY_TEST' > > > > INC_RETURN_FAMILY_TEST(, v0); > > > > ^ > > > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > > > >> 'atomic_inc_return_release' [-Werror=implicit-function-declaration] > > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > > ^ > > > >include/linux/compiler.h:166:42: note: in definition of macro > > > > 'unlikely' > > > > # define unlikely(x) __builtin_expect(!!(x), 0) > > > > ^ > > > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > > ^ > > > >lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_ARGS' > > > > test(bit, op##_release, ##args); \ > > > > ^ > > > > >> lib/atomic64_test.c:79:2: note: in
Re: [lkp] [PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
Hi Fengguang, On Mon, Oct 12, 2015 at 11:29:14PM +0800, Fengguang Wu wrote: > Hi Boqun, > > The base tree detection is based on the whole patchset's > > - subjects > - touched files > - TO/CC list > > Log shows the files and TO/CC are strongly related to powerpc, > so it looks a natural choice to apply to it. Especially you put > "linuxppc-...@lists.ozlabs.org" in the TO list while Peter/Ingo > in the CC list -- that looks like a strong indication for powerpc. > Thank you for your explanation, so how about modifying the title to: [PATCH v3 tip/locking/core 2/6] ... also works? BTW, does this bot have more tests than 0day? I have pushed this patchset to my own repo and had it tested by 0day. Regards, Boqun > [2015-10-12 22:27:49] patched_files: ["arch/powerpc/include/asm/cmpxchg.h", > "lib/atomic64_test.c", "include/linux/atomic.h", > "arch/powerpc/include/asm/atomic.h"] > [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next"] > > [2015-10-12 22:27:49] lists: ["linux-kernel@vger.kernel.org", > "linuxppc-...@lists.ozlabs.org", "Peter Zijlstra ", > "Ingo Molnar " > , "Benjamin Herrenschmidt ", "Paul Mackerras > ", "Michael Ellerman ", "Thomas > Gleixner e>", "Will Deacon ", "\"Paul E. McKenney\" > ", "Waiman Long ", "Davidlohr > Bueso " > , "Boqun Feng "] > [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next", "powerpc/next", > "mpe/next", "mpe/next", "arm64/for-next/core", "arm64/for-next/core"] > > The possible improvement would be to let tip:locking/core register > itself in the MAINTAINERS file to match files *cmpxchg* *atomic*. > > Thanks, > Fengguang > > On Mon, Oct 12, 2015 at 10:56:52PM +0800, Boqun Feng wrote: > > On Mon, Oct 12, 2015 at 10:43:56PM +0800, kbuild test robot wrote: > > > Hi Boqun, > > > > > > [auto build test ERROR on v4.3-rc5 -- if it's inappropriate base, please > > > suggest rules for selecting the more suitable base] > > > > > > > This patch should be tested based on current locking/core branch of tip > > tree. Thank you. > > > > Regards, > > Boqun > > > > > url: > > > https://github.com/0day-ci/linux/commits/Boqun-Feng/atomics-powerpc-Implement-relaxed-acquire-release-variants-of-some-atomics/20151012-222750 > > > config: x86_64-randconfig-x016-10121751 (attached as .config) > > > reproduce: > > > # save the attached .config to linux build tree > > > make ARCH=x86_64 > > > > > > All error/warnings (new ones prefixed by >>): > > > > > >In file included from include/linux/init.h:4:0, > > > from lib/atomic64_test.c:14: > > >lib/atomic64_test.c: In function 'test_atomic': > > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > > >> 'atomic_inc_return_acquire' [-Werror=implicit-function-declaration] > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > ^ > > >include/linux/compiler.h:166:42: note: in definition of macro > > > 'unlikely' > > > # define unlikely(x) __builtin_expect(!!(x), 0) > > > ^ > > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > ^ > > > >> lib/atomic64_test.c:38:2: note: in expansion of macro 'TEST_ARGS' > > > test(bit, op##_acquire, ##args); \ > > > ^ > > > >> lib/atomic64_test.c:79:2: note: in expansion of macro 'FAMILY_TEST' > > > FAMILY_TEST(TEST_ARGS, bit, inc_return, \ > > > ^ > > > >> lib/atomic64_test.c:113:2: note: in expansion of macro > > > >> 'INC_RETURN_FAMILY_TEST' > > > INC_RETURN_FAMILY_TEST(, v0); > > > ^ > > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > > >> 'atomic_inc_return_release' [-Werror=implicit-function-declaration] > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > ^ > > >include/linux/compiler.h:166:42: note: in definition of macro > > > 'unlikely' > > > # define unlikely(x) __builtin_expect(!!(x), 0) > > > ^ > > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > ^ > > >lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_ARGS' > > > test(bit, op##_release, ##args); \ > > > ^ > > > >> lib/atomic64_test.c:79:2: note: in expansion of macro 'FAMILY_TEST' > > > FAMILY_TEST(TEST_ARGS, bit, inc_return, \ > > > ^ > > > >> lib/atomic64_test.c:113:2: note: in expansion of macro > > > >> 'INC_RETURN_FAMILY_TEST' > > > INC_RETURN_FAMILY_TEST(, v0); > > > ^ > > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > > >> 'atomic_inc_return_relaxed' [-Werror=implicit-function-declaration] > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > ^ > > >include/linux/compiler.h:166:42: note: in definition of macro > > > 'unlikely' > > > # define
Re: [lkp] [PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
Hi Boqun, The base tree detection is based on the whole patchset's - subjects - touched files - TO/CC list Log shows the files and TO/CC are strongly related to powerpc, so it looks a natural choice to apply to it. Especially you put "linuxppc-...@lists.ozlabs.org" in the TO list while Peter/Ingo in the CC list -- that looks like a strong indication for powerpc. [2015-10-12 22:27:49] patched_files: ["arch/powerpc/include/asm/cmpxchg.h", "lib/atomic64_test.c", "include/linux/atomic.h", "arch/powerpc/include/asm/atomic.h"] [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next"] [2015-10-12 22:27:49] lists: ["linux-kernel@vger.kernel.org", "linuxppc-...@lists.ozlabs.org", "Peter Zijlstra ", "Ingo Molnar " , "Benjamin Herrenschmidt ", "Paul Mackerras ", "Michael Ellerman ", "Thomas Gleixner ", "Will Deacon ", "\"Paul E. McKenney\" ", "Waiman Long ", "Davidlohr Bueso " , "Boqun Feng "] [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next", "powerpc/next", "mpe/next", "mpe/next", "arm64/for-next/core", "arm64/for-next/core"] The possible improvement would be to let tip:locking/core register itself in the MAINTAINERS file to match files *cmpxchg* *atomic*. Thanks, Fengguang On Mon, Oct 12, 2015 at 10:56:52PM +0800, Boqun Feng wrote: > On Mon, Oct 12, 2015 at 10:43:56PM +0800, kbuild test robot wrote: > > Hi Boqun, > > > > [auto build test ERROR on v4.3-rc5 -- if it's inappropriate base, please > > suggest rules for selecting the more suitable base] > > > > This patch should be tested based on current locking/core branch of tip > tree. Thank you. > > Regards, > Boqun > > > url: > > https://github.com/0day-ci/linux/commits/Boqun-Feng/atomics-powerpc-Implement-relaxed-acquire-release-variants-of-some-atomics/20151012-222750 > > config: x86_64-randconfig-x016-10121751 (attached as .config) > > reproduce: > > # save the attached .config to linux build tree > > make ARCH=x86_64 > > > > All error/warnings (new ones prefixed by >>): > > > >In file included from include/linux/init.h:4:0, > > from lib/atomic64_test.c:14: > >lib/atomic64_test.c: In function 'test_atomic': > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > >> 'atomic_inc_return_acquire' [-Werror=implicit-function-declaration] > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > >include/linux/compiler.h:166:42: note: in definition of macro 'unlikely' > > # define unlikely(x) __builtin_expect(!!(x), 0) > > ^ > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > > >> lib/atomic64_test.c:38:2: note: in expansion of macro 'TEST_ARGS' > > test(bit, op##_acquire, ##args); \ > > ^ > > >> lib/atomic64_test.c:79:2: note: in expansion of macro 'FAMILY_TEST' > > FAMILY_TEST(TEST_ARGS, bit, inc_return, \ > > ^ > > >> lib/atomic64_test.c:113:2: note: in expansion of macro > > >> 'INC_RETURN_FAMILY_TEST' > > INC_RETURN_FAMILY_TEST(, v0); > > ^ > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > >> 'atomic_inc_return_release' [-Werror=implicit-function-declaration] > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > >include/linux/compiler.h:166:42: note: in definition of macro 'unlikely' > > # define unlikely(x) __builtin_expect(!!(x), 0) > > ^ > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > >lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_ARGS' > > test(bit, op##_release, ##args); \ > > ^ > > >> lib/atomic64_test.c:79:2: note: in expansion of macro 'FAMILY_TEST' > > FAMILY_TEST(TEST_ARGS, bit, inc_return, \ > > ^ > > >> lib/atomic64_test.c:113:2: note: in expansion of macro > > >> 'INC_RETURN_FAMILY_TEST' > > INC_RETURN_FAMILY_TEST(, v0); > > ^ > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > >> 'atomic_inc_return_relaxed' [-Werror=implicit-function-declaration] > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > >include/linux/compiler.h:166:42: note: in definition of macro 'unlikely' > > # define unlikely(x) __builtin_expect(!!(x), 0) > > ^ > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > >lib/atomic64_test.c:40:2: note: in expansion of macro 'TEST_ARGS' > > test(bit, op##_relaxed, ##args); \ > > ^ > > >> lib/atomic64_test.c:79:2: note: in expansion of macro 'FAMILY_TEST' > > FAMILY_TEST(TEST_ARGS, bit, inc_return, \ > > ^ > > >> lib/atomic64_test.c:113:2: note: in expansion of macro > > >>
[PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
Some atomic operations now have _{relaxed, acquire, release} variants, this patch then adds some trivial tests for two purpose: 1. test the behavior of these new operations in single-CPU environment. 2. make their code generated before we actually use them somewhere, so that we can examine their assembly code. Signed-off-by: Boqun Feng --- lib/atomic64_test.c | 120 ++-- 1 file changed, 79 insertions(+), 41 deletions(-) diff --git a/lib/atomic64_test.c b/lib/atomic64_test.c index 83c33a5b..18e422b 100644 --- a/lib/atomic64_test.c +++ b/lib/atomic64_test.c @@ -27,6 +27,65 @@ do { \ (unsigned long long)r); \ } while (0) +/* + * Test for a atomic operation family, + * @test should be a macro accepting parameters (bit, op, ...) + */ + +#define FAMILY_TEST(test, bit, op, args...)\ +do { \ + test(bit, op, ##args); \ + test(bit, op##_acquire, ##args);\ + test(bit, op##_release, ##args);\ + test(bit, op##_relaxed, ##args);\ +} while (0) + +#define TEST_RETURN(bit, op, c_op, val)\ +do { \ + atomic##bit##_set(, v0); \ + r = v0; \ + r c_op val; \ + BUG_ON(atomic##bit##_##op(val, ) != r); \ + BUG_ON(atomic##bit##_read() != r);\ +} while (0) + +#define RETURN_FAMILY_TEST(bit, op, c_op, val) \ +do { \ + FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \ +} while (0) + +#define TEST_ARGS(bit, op, init, ret, expect, args...) \ +do { \ + atomic##bit##_set(, init);\ + BUG_ON(atomic##bit##_##op(, ##args) != ret); \ + BUG_ON(atomic##bit##_read() != expect); \ +} while (0) + +#define XCHG_FAMILY_TEST(bit, init, new) \ +do { \ + FAMILY_TEST(TEST_ARGS, bit, xchg, init, init, new, new);\ +} while (0) + +#define CMPXCHG_FAMILY_TEST(bit, init, new, wrong) \ +do { \ + FAMILY_TEST(TEST_ARGS, bit, cmpxchg,\ + init, init, new, init, new);\ + FAMILY_TEST(TEST_ARGS, bit, cmpxchg,\ + init, init, init, wrong, new); \ +} while (0) + +#define INC_RETURN_FAMILY_TEST(bit, i) \ +do { \ + FAMILY_TEST(TEST_ARGS, bit, inc_return, \ + i, (i) + one, (i) + one); \ +} while (0) + +#define DEC_RETURN_FAMILY_TEST(bit, i) \ +do { \ + FAMILY_TEST(TEST_ARGS, bit, dec_return, \ + i, (i) - one, (i) - one); \ +} while (0) + static __init void test_atomic(void) { int v0 = 0xaaa31337; @@ -45,6 +104,18 @@ static __init void test_atomic(void) TEST(, and, &=, v1); TEST(, xor, ^=, v1); TEST(, andnot, &= ~, v1); + + RETURN_FAMILY_TEST(, add_return, +=, onestwos); + RETURN_FAMILY_TEST(, add_return, +=, -one); + RETURN_FAMILY_TEST(, sub_return, -=, onestwos); + RETURN_FAMILY_TEST(, sub_return, -=, -one); + + INC_RETURN_FAMILY_TEST(, v0); + DEC_RETURN_FAMILY_TEST(, v0); + + XCHG_FAMILY_TEST(, v0, v1); + CMPXCHG_FAMILY_TEST(, v0, v1, onestwos); + } #define INIT(c) do { atomic64_set(, c); r = c; } while (0) @@ -74,25 +145,10 @@ static __init void test_atomic64(void) TEST(64, xor, ^=, v1); TEST(64, andnot, &= ~, v1); - INIT(v0); - r += onestwos; - BUG_ON(atomic64_add_return(onestwos, ) != r); - BUG_ON(v.counter != r); - - INIT(v0); - r += -one; - BUG_ON(atomic64_add_return(-one, ) != r); - BUG_ON(v.counter != r); - - INIT(v0); - r -= onestwos; - BUG_ON(atomic64_sub_return(onestwos, ) != r); - BUG_ON(v.counter != r); - - INIT(v0); - r -= -one; - BUG_ON(atomic64_sub_return(-one, ) != r); - BUG_ON(v.counter != r); + RETURN_FAMILY_TEST(64, add_return, +=, onestwos); + RETURN_FAMILY_TEST(64, add_return, +=, -one); + RETURN_FAMILY_TEST(64, sub_return, -=, onestwos); + RETURN_FAMILY_TEST(64, sub_return, -=, -one); INIT(v0);
Re: [kbuild-all] [lkp] [PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
On Mon, Oct 12, 2015 at 11:42:24PM +0800, Boqun Feng wrote: > Hi Fengguang, > > On Mon, Oct 12, 2015 at 11:29:14PM +0800, Fengguang Wu wrote: > > Hi Boqun, > > > > The base tree detection is based on the whole patchset's > > > > - subjects > > - touched files > > - TO/CC list > > > > Log shows the files and TO/CC are strongly related to powerpc, > > so it looks a natural choice to apply to it. Especially you put > > "linuxppc-...@lists.ozlabs.org" in the TO list while Peter/Ingo > > in the CC list -- that looks like a strong indication for powerpc. > > > > Thank you for your explanation, so how about modifying the title to: > > [PATCH v3 tip/locking/core 2/6] ... > > also works? Yes it will work -- that'd be the most strong hint. > BTW, does this bot have more tests than 0day? I have pushed this > patchset to my own repo and had it tested by 0day. Yes, it runs git am, the resulted commits are feed to 0day for build/boot/performance tests. If you've already pushed the patches via git, the robot should have skip such duplicate tests on the emailed patches -- unless there is a bug. I'll have a check. Thanks, Fengguang > > [2015-10-12 22:27:49] patched_files: ["arch/powerpc/include/asm/cmpxchg.h", > > "lib/atomic64_test.c", "include/linux/atomic.h", > > "arch/powerpc/include/asm/atomic.h"] > > [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next"] > > > > [2015-10-12 22:27:49] lists: ["linux-kernel@vger.kernel.org", > > "linuxppc-...@lists.ozlabs.org", "Peter Zijlstra", > > "Ingo Molnar " > > , "Benjamin Herrenschmidt ", "Paul Mackerras > > ", "Michael Ellerman ", "Thomas > > Gleixner > e>", "Will Deacon ", "\"Paul E. McKenney\" > > ", "Waiman Long ", > > "Davidlohr Bueso " > > , "Boqun Feng "] > > [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next", > > "powerpc/next", "mpe/next", "mpe/next", "arm64/for-next/core", > > "arm64/for-next/core"] > > > > The possible improvement would be to let tip:locking/core register > > itself in the MAINTAINERS file to match files *cmpxchg* *atomic*. > > > > Thanks, > > Fengguang > > > > On Mon, Oct 12, 2015 at 10:56:52PM +0800, Boqun Feng wrote: > > > On Mon, Oct 12, 2015 at 10:43:56PM +0800, kbuild test robot wrote: > > > > Hi Boqun, > > > > > > > > [auto build test ERROR on v4.3-rc5 -- if it's inappropriate base, > > > > please suggest rules for selecting the more suitable base] > > > > > > > > > > This patch should be tested based on current locking/core branch of tip > > > tree. Thank you. > > > > > > Regards, > > > Boqun > > > > > > > url: > > > > https://github.com/0day-ci/linux/commits/Boqun-Feng/atomics-powerpc-Implement-relaxed-acquire-release-variants-of-some-atomics/20151012-222750 > > > > config: x86_64-randconfig-x016-10121751 (attached as .config) > > > > reproduce: > > > > # save the attached .config to linux build tree > > > > make ARCH=x86_64 > > > > > > > > All error/warnings (new ones prefixed by >>): > > > > > > > >In file included from include/linux/init.h:4:0, > > > > from lib/atomic64_test.c:14: > > > >lib/atomic64_test.c: In function 'test_atomic': > > > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > > > >> 'atomic_inc_return_acquire' [-Werror=implicit-function-declaration] > > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > > ^ > > > >include/linux/compiler.h:166:42: note: in definition of macro > > > > 'unlikely' > > > > # define unlikely(x) __builtin_expect(!!(x), 0) > > > > ^ > > > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > > ^ > > > > >> lib/atomic64_test.c:38:2: note: in expansion of macro 'TEST_ARGS' > > > > test(bit, op##_acquire, ##args); \ > > > > ^ > > > > >> lib/atomic64_test.c:79:2: note: in expansion of macro 'FAMILY_TEST' > > > > FAMILY_TEST(TEST_ARGS, bit, inc_return, \ > > > > ^ > > > > >> lib/atomic64_test.c:113:2: note: in expansion of macro > > > > >> 'INC_RETURN_FAMILY_TEST' > > > > INC_RETURN_FAMILY_TEST(, v0); > > > > ^ > > > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > > > >> 'atomic_inc_return_release' [-Werror=implicit-function-declaration] > > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > > ^ > > > >include/linux/compiler.h:166:42: note: in definition of macro > > > > 'unlikely' > > > > # define unlikely(x) __builtin_expect(!!(x), 0) > > > > ^ > > > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > > >
Re: [lkp] [PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
Hi Boqun, The base tree detection is based on the whole patchset's - subjects - touched files - TO/CC list Log shows the files and TO/CC are strongly related to powerpc, so it looks a natural choice to apply to it. Especially you put "linuxppc-...@lists.ozlabs.org" in the TO list while Peter/Ingo in the CC list -- that looks like a strong indication for powerpc. [2015-10-12 22:27:49] patched_files: ["arch/powerpc/include/asm/cmpxchg.h", "lib/atomic64_test.c", "include/linux/atomic.h", "arch/powerpc/include/asm/atomic.h"] [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next"] [2015-10-12 22:27:49] lists: ["linux-kernel@vger.kernel.org", "linuxppc-...@lists.ozlabs.org", "Peter Zijlstra", "Ingo Molnar " , "Benjamin Herrenschmidt ", "Paul Mackerras ", "Michael Ellerman ", "Thomas Gleixner ", "Will Deacon ", "\"Paul E. McKenney\" ", "Waiman Long ", "Davidlohr Bueso " , "Boqun Feng "] [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next", "powerpc/next", "mpe/next", "mpe/next", "arm64/for-next/core", "arm64/for-next/core"] The possible improvement would be to let tip:locking/core register itself in the MAINTAINERS file to match files *cmpxchg* *atomic*. Thanks, Fengguang On Mon, Oct 12, 2015 at 10:56:52PM +0800, Boqun Feng wrote: > On Mon, Oct 12, 2015 at 10:43:56PM +0800, kbuild test robot wrote: > > Hi Boqun, > > > > [auto build test ERROR on v4.3-rc5 -- if it's inappropriate base, please > > suggest rules for selecting the more suitable base] > > > > This patch should be tested based on current locking/core branch of tip > tree. Thank you. > > Regards, > Boqun > > > url: > > https://github.com/0day-ci/linux/commits/Boqun-Feng/atomics-powerpc-Implement-relaxed-acquire-release-variants-of-some-atomics/20151012-222750 > > config: x86_64-randconfig-x016-10121751 (attached as .config) > > reproduce: > > # save the attached .config to linux build tree > > make ARCH=x86_64 > > > > All error/warnings (new ones prefixed by >>): > > > >In file included from include/linux/init.h:4:0, > > from lib/atomic64_test.c:14: > >lib/atomic64_test.c: In function 'test_atomic': > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > >> 'atomic_inc_return_acquire' [-Werror=implicit-function-declaration] > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > >include/linux/compiler.h:166:42: note: in definition of macro 'unlikely' > > # define unlikely(x) __builtin_expect(!!(x), 0) > > ^ > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > > >> lib/atomic64_test.c:38:2: note: in expansion of macro 'TEST_ARGS' > > test(bit, op##_acquire, ##args); \ > > ^ > > >> lib/atomic64_test.c:79:2: note: in expansion of macro 'FAMILY_TEST' > > FAMILY_TEST(TEST_ARGS, bit, inc_return, \ > > ^ > > >> lib/atomic64_test.c:113:2: note: in expansion of macro > > >> 'INC_RETURN_FAMILY_TEST' > > INC_RETURN_FAMILY_TEST(, v0); > > ^ > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > >> 'atomic_inc_return_release' [-Werror=implicit-function-declaration] > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > >include/linux/compiler.h:166:42: note: in definition of macro 'unlikely' > > # define unlikely(x) __builtin_expect(!!(x), 0) > > ^ > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > >lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_ARGS' > > test(bit, op##_release, ##args); \ > > ^ > > >> lib/atomic64_test.c:79:2: note: in expansion of macro 'FAMILY_TEST' > > FAMILY_TEST(TEST_ARGS, bit, inc_return, \ > > ^ > > >> lib/atomic64_test.c:113:2: note: in expansion of macro > > >> 'INC_RETURN_FAMILY_TEST' > > INC_RETURN_FAMILY_TEST(, v0); > > ^ > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > >> 'atomic_inc_return_relaxed' [-Werror=implicit-function-declaration] > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > >include/linux/compiler.h:166:42: note: in definition of macro 'unlikely' > > # define unlikely(x) __builtin_expect(!!(x), 0) > > ^ > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > ^ > >lib/atomic64_test.c:40:2: note: in expansion of macro 'TEST_ARGS' > > test(bit, op##_relaxed, ##args);
Re: [lkp] [PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
Hi Fengguang, On Mon, Oct 12, 2015 at 11:29:14PM +0800, Fengguang Wu wrote: > Hi Boqun, > > The base tree detection is based on the whole patchset's > > - subjects > - touched files > - TO/CC list > > Log shows the files and TO/CC are strongly related to powerpc, > so it looks a natural choice to apply to it. Especially you put > "linuxppc-...@lists.ozlabs.org" in the TO list while Peter/Ingo > in the CC list -- that looks like a strong indication for powerpc. > Thank you for your explanation, so how about modifying the title to: [PATCH v3 tip/locking/core 2/6] ... also works? BTW, does this bot have more tests than 0day? I have pushed this patchset to my own repo and had it tested by 0day. Regards, Boqun > [2015-10-12 22:27:49] patched_files: ["arch/powerpc/include/asm/cmpxchg.h", > "lib/atomic64_test.c", "include/linux/atomic.h", > "arch/powerpc/include/asm/atomic.h"] > [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next"] > > [2015-10-12 22:27:49] lists: ["linux-kernel@vger.kernel.org", > "linuxppc-...@lists.ozlabs.org", "Peter Zijlstra", > "Ingo Molnar " > , "Benjamin Herrenschmidt ", "Paul Mackerras > ", "Michael Ellerman ", "Thomas > Gleixner e>", "Will Deacon ", "\"Paul E. McKenney\" > ", "Waiman Long ", "Davidlohr > Bueso " > , "Boqun Feng "] > [2015-10-12 22:27:49] bases: ["powerpc/next", "powerpc/next", "powerpc/next", > "mpe/next", "mpe/next", "arm64/for-next/core", "arm64/for-next/core"] > > The possible improvement would be to let tip:locking/core register > itself in the MAINTAINERS file to match files *cmpxchg* *atomic*. > > Thanks, > Fengguang > > On Mon, Oct 12, 2015 at 10:56:52PM +0800, Boqun Feng wrote: > > On Mon, Oct 12, 2015 at 10:43:56PM +0800, kbuild test robot wrote: > > > Hi Boqun, > > > > > > [auto build test ERROR on v4.3-rc5 -- if it's inappropriate base, please > > > suggest rules for selecting the more suitable base] > > > > > > > This patch should be tested based on current locking/core branch of tip > > tree. Thank you. > > > > Regards, > > Boqun > > > > > url: > > > https://github.com/0day-ci/linux/commits/Boqun-Feng/atomics-powerpc-Implement-relaxed-acquire-release-variants-of-some-atomics/20151012-222750 > > > config: x86_64-randconfig-x016-10121751 (attached as .config) > > > reproduce: > > > # save the attached .config to linux build tree > > > make ARCH=x86_64 > > > > > > All error/warnings (new ones prefixed by >>): > > > > > >In file included from include/linux/init.h:4:0, > > > from lib/atomic64_test.c:14: > > >lib/atomic64_test.c: In function 'test_atomic': > > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > > >> 'atomic_inc_return_acquire' [-Werror=implicit-function-declaration] > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > ^ > > >include/linux/compiler.h:166:42: note: in definition of macro > > > 'unlikely' > > > # define unlikely(x) __builtin_expect(!!(x), 0) > > > ^ > > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > ^ > > > >> lib/atomic64_test.c:38:2: note: in expansion of macro 'TEST_ARGS' > > > test(bit, op##_acquire, ##args); \ > > > ^ > > > >> lib/atomic64_test.c:79:2: note: in expansion of macro 'FAMILY_TEST' > > > FAMILY_TEST(TEST_ARGS, bit, inc_return, \ > > > ^ > > > >> lib/atomic64_test.c:113:2: note: in expansion of macro > > > >> 'INC_RETURN_FAMILY_TEST' > > > INC_RETURN_FAMILY_TEST(, v0); > > > ^ > > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > > >> 'atomic_inc_return_release' [-Werror=implicit-function-declaration] > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > ^ > > >include/linux/compiler.h:166:42: note: in definition of macro > > > 'unlikely' > > > # define unlikely(x) __builtin_expect(!!(x), 0) > > > ^ > > > >> lib/atomic64_test.c:60:2: note: in expansion of macro 'BUG_ON' > > > BUG_ON(atomic##bit##_##op(, ##args) != ret); \ > > > ^ > > >lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_ARGS' > > > test(bit, op##_release, ##args); \ > > > ^ > > > >> lib/atomic64_test.c:79:2: note: in expansion of macro 'FAMILY_TEST' > > > FAMILY_TEST(TEST_ARGS, bit, inc_return, \ > > > ^ > > > >> lib/atomic64_test.c:113:2: note: in expansion of macro > > > >> 'INC_RETURN_FAMILY_TEST' > > > INC_RETURN_FAMILY_TEST(, v0); > > > ^ > > > >> lib/atomic64_test.c:60:9: error: implicit declaration of function > > > >> 'atomic_inc_return_relaxed'
Re: [kbuild-all] [lkp] [PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
> > BTW, does this bot have more tests than 0day? I have pushed this > > patchset to my own repo and had it tested by 0day. > > Yes, it runs git am, the resulted commits are feed to 0day for > build/boot/performance tests. If you've already pushed the patches via > git, the robot should have skip such duplicate tests on the emailed > patches -- unless there is a bug. I'll have a check. Ah yes, there is a silly bug.. Fixed, thanks! Fengguang -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
Some atomic operations now have _{relaxed, acquire, release} variants, this patch then adds some trivial tests for two purpose: 1. test the behavior of these new operations in single-CPU environment. 2. make their code generated before we actually use them somewhere, so that we can examine their assembly code. Signed-off-by: Boqun Feng--- lib/atomic64_test.c | 120 ++-- 1 file changed, 79 insertions(+), 41 deletions(-) diff --git a/lib/atomic64_test.c b/lib/atomic64_test.c index 83c33a5b..18e422b 100644 --- a/lib/atomic64_test.c +++ b/lib/atomic64_test.c @@ -27,6 +27,65 @@ do { \ (unsigned long long)r); \ } while (0) +/* + * Test for a atomic operation family, + * @test should be a macro accepting parameters (bit, op, ...) + */ + +#define FAMILY_TEST(test, bit, op, args...)\ +do { \ + test(bit, op, ##args); \ + test(bit, op##_acquire, ##args);\ + test(bit, op##_release, ##args);\ + test(bit, op##_relaxed, ##args);\ +} while (0) + +#define TEST_RETURN(bit, op, c_op, val)\ +do { \ + atomic##bit##_set(, v0); \ + r = v0; \ + r c_op val; \ + BUG_ON(atomic##bit##_##op(val, ) != r); \ + BUG_ON(atomic##bit##_read() != r);\ +} while (0) + +#define RETURN_FAMILY_TEST(bit, op, c_op, val) \ +do { \ + FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \ +} while (0) + +#define TEST_ARGS(bit, op, init, ret, expect, args...) \ +do { \ + atomic##bit##_set(, init);\ + BUG_ON(atomic##bit##_##op(, ##args) != ret); \ + BUG_ON(atomic##bit##_read() != expect); \ +} while (0) + +#define XCHG_FAMILY_TEST(bit, init, new) \ +do { \ + FAMILY_TEST(TEST_ARGS, bit, xchg, init, init, new, new);\ +} while (0) + +#define CMPXCHG_FAMILY_TEST(bit, init, new, wrong) \ +do { \ + FAMILY_TEST(TEST_ARGS, bit, cmpxchg,\ + init, init, new, init, new);\ + FAMILY_TEST(TEST_ARGS, bit, cmpxchg,\ + init, init, init, wrong, new); \ +} while (0) + +#define INC_RETURN_FAMILY_TEST(bit, i) \ +do { \ + FAMILY_TEST(TEST_ARGS, bit, inc_return, \ + i, (i) + one, (i) + one); \ +} while (0) + +#define DEC_RETURN_FAMILY_TEST(bit, i) \ +do { \ + FAMILY_TEST(TEST_ARGS, bit, dec_return, \ + i, (i) - one, (i) - one); \ +} while (0) + static __init void test_atomic(void) { int v0 = 0xaaa31337; @@ -45,6 +104,18 @@ static __init void test_atomic(void) TEST(, and, &=, v1); TEST(, xor, ^=, v1); TEST(, andnot, &= ~, v1); + + RETURN_FAMILY_TEST(, add_return, +=, onestwos); + RETURN_FAMILY_TEST(, add_return, +=, -one); + RETURN_FAMILY_TEST(, sub_return, -=, onestwos); + RETURN_FAMILY_TEST(, sub_return, -=, -one); + + INC_RETURN_FAMILY_TEST(, v0); + DEC_RETURN_FAMILY_TEST(, v0); + + XCHG_FAMILY_TEST(, v0, v1); + CMPXCHG_FAMILY_TEST(, v0, v1, onestwos); + } #define INIT(c) do { atomic64_set(, c); r = c; } while (0) @@ -74,25 +145,10 @@ static __init void test_atomic64(void) TEST(64, xor, ^=, v1); TEST(64, andnot, &= ~, v1); - INIT(v0); - r += onestwos; - BUG_ON(atomic64_add_return(onestwos, ) != r); - BUG_ON(v.counter != r); - - INIT(v0); - r += -one; - BUG_ON(atomic64_add_return(-one, ) != r); - BUG_ON(v.counter != r); - - INIT(v0); - r -= onestwos; - BUG_ON(atomic64_sub_return(onestwos, ) != r); - BUG_ON(v.counter != r); - - INIT(v0); - r -= -one; - BUG_ON(atomic64_sub_return(-one, ) != r); - BUG_ON(v.counter != r); + RETURN_FAMILY_TEST(64, add_return, +=, onestwos); + RETURN_FAMILY_TEST(64, add_return, +=, -one); + RETURN_FAMILY_TEST(64, sub_return, -=, onestwos); + RETURN_FAMILY_TEST(64, sub_return, -=, -one);
Re: [kbuild-all] [lkp] [PATCH v3 2/6] atomics: Add test for atomic operations with _relaxed variants
On Tue, Oct 13, 2015 at 12:02:00AM +0800, Fengguang Wu wrote: > On Mon, Oct 12, 2015 at 11:42:24PM +0800, Boqun Feng wrote: > > Hi Fengguang, > > > > On Mon, Oct 12, 2015 at 11:29:14PM +0800, Fengguang Wu wrote: > > > Hi Boqun, > > > > > > The base tree detection is based on the whole patchset's > > > > > > - subjects > > > - touched files > > > - TO/CC list > > > > > > Log shows the files and TO/CC are strongly related to powerpc, > > > so it looks a natural choice to apply to it. Especially you put > > > "linuxppc-...@lists.ozlabs.org" in the TO list while Peter/Ingo > > > in the CC list -- that looks like a strong indication for powerpc. > > > > > > > Thank you for your explanation, so how about modifying the title to: > > > > [PATCH v3 tip/locking/core 2/6] ... > > > > also works? > > Yes it will work -- that'd be the most strong hint. > Great! I will use that hint in the future, thank you ;-) > > BTW, does this bot have more tests than 0day? I have pushed this > > patchset to my own repo and had it tested by 0day. > > Yes, it runs git am, the resulted commits are feed to 0day for > build/boot/performance tests. If you've already pushed the patches via > git, the robot should have skip such duplicate tests on the emailed > patches -- unless there is a bug. I'll have a check. > Thank you, so I'm not going to resend this v3 patchset, will use the subject hint for any future patchset ;-) Regards, Boqun signature.asc Description: PGP signature