diff mbox

Correct minimal test suite changes for elision enabled kernels.

Message ID lhub7k$7jj$1@ger.gmane.org
State New
Headers show

Commit Message

Stefan Liebler April 7, 2014, 2:03 p.m. UTC
Hi,
according to the comment of Andi Kleen (see below),
i´ve dropped the ifdef.
Please test it on an intel machine with lock elision support!

Bye

---
2014-04-07  Stefan Liebler  <stli@linux.vnet.ibm.com>

	* nptl/tst-mutex5 (do_test):
	Remove #ifdef ENABLE_LOCK_ELISION.
---

On Fri, Apr 04, 2014 at 01:52:18PM +0200, Stefan Liebler wrote:
 > Hi,
 >
 > according to the comment in
 > "Re: [PATCH 03/14] Add minimal test suite changes for elision
 > enabled kernels"
 > (https://www.sourceware.org/ml/libc-alpha/2013-06/msg01145.html),
 > the tests tst-mutex5/8 are changed in order to not check some
 > behaviour of POSIX if lock elision is enabled at configure time.
 > Currently, the timeout of pthread_mutex_timedlock is only tested
 > with elision enabled at configure time and not for the default case.

If it works with elision we can actually drop the ifdef,
as it should work in both cases.

May have been a left over from before trylock aborted.

-Andi

 >
 > Bye
 >
 > ---
 > 2014-04-04  Stefan Liebler  <stli@linux.vnet.ibm.com>
 >
 > 	* nptl/tst-mutex5 (do_test):
 > 	Use #ifndef ENABLE_LOCK_ELISION instead of #ifdef.
 > ---

 > diff --git a/nptl/tst-mutex5.c b/nptl/tst-mutex5.c
 > index 14d3025..a829272 100644
 > --- a/nptl/tst-mutex5.c
 > +++ b/nptl/tst-mutex5.c
 > @@ -87,7 +87,7 @@ do_test (void)
 >      }
 >
 >    /* Elided locks do not time out.  */
 > -#ifdef ENABLE_LOCK_ELISION
 > +#ifndef ENABLE_LOCK_ELISION
 >    if (pthread_mutex_trylock (&m) == 0)
 >      {
 >        puts ("mutex_trylock succeeded");


-- ak@linux.intel.com -- Speaking for myself only

Comments

Stefan Liebler April 14, 2014, 7:04 a.m. UTC | #1
ping.

ok to commit?

On 04/07/2014 04:03 PM, Stefan Liebler wrote:
> Hi,
> according to the comment of Andi Kleen (see below),
> i´ve dropped the ifdef.
> Please test it on an intel machine with lock elision support!
>
> Bye
>
> ---
> 2014-04-07  Stefan Liebler  <stli@linux.vnet.ibm.com>
>
>      * nptl/tst-mutex5 (do_test):
>      Remove #ifdef ENABLE_LOCK_ELISION.
> ---
>
> On Fri, Apr 04, 2014 at 01:52:18PM +0200, Stefan Liebler wrote:
>  > Hi,
>  >
>  > according to the comment in
>  > "Re: [PATCH 03/14] Add minimal test suite changes for elision
>  > enabled kernels"
>  > (https://www.sourceware.org/ml/libc-alpha/2013-06/msg01145.html),
>  > the tests tst-mutex5/8 are changed in order to not check some
>  > behaviour of POSIX if lock elision is enabled at configure time.
>  > Currently, the timeout of pthread_mutex_timedlock is only tested
>  > with elision enabled at configure time and not for the default case.
>
> If it works with elision we can actually drop the ifdef,
> as it should work in both cases.
>
> May have been a left over from before trylock aborted.
>
> -Andi
>
>  >
>  > Bye
>  >
>  > ---
>  > 2014-04-04  Stefan Liebler  <stli@linux.vnet.ibm.com>
>  >
>  >     * nptl/tst-mutex5 (do_test):
>  >     Use #ifndef ENABLE_LOCK_ELISION instead of #ifdef.
>  > ---
>
>  > diff --git a/nptl/tst-mutex5.c b/nptl/tst-mutex5.c
>  > index 14d3025..a829272 100644
>  > --- a/nptl/tst-mutex5.c
>  > +++ b/nptl/tst-mutex5.c
>  > @@ -87,7 +87,7 @@ do_test (void)
>  >      }
>  >
>  >    /* Elided locks do not time out.  */
>  > -#ifdef ENABLE_LOCK_ELISION
>  > +#ifndef ENABLE_LOCK_ELISION
>  >    if (pthread_mutex_trylock (&m) == 0)
>  >      {
>  >        puts ("mutex_trylock succeeded");
>
>
> -- ak@linux.intel.com -- Speaking for myself only
Stefan Liebler April 23, 2014, 11:30 a.m. UTC | #2
ping
On 04/14/2014 09:04 AM, Stefan Liebler wrote:
> ping.
>
> ok to commit?
>
> On 04/07/2014 04:03 PM, Stefan Liebler wrote:
>> Hi,
>> according to the comment of Andi Kleen (see below),
>> i´ve dropped the ifdef.
>> Please test it on an intel machine with lock elision support!
>>
>> Bye
>>
>> ---
>> 2014-04-07  Stefan Liebler  <stli@linux.vnet.ibm.com>
>>
>>      * nptl/tst-mutex5 (do_test):
>>      Remove #ifdef ENABLE_LOCK_ELISION.
>> ---
>>
>> On Fri, Apr 04, 2014 at 01:52:18PM +0200, Stefan Liebler wrote:
>>  > Hi,
>>  >
>>  > according to the comment in
>>  > "Re: [PATCH 03/14] Add minimal test suite changes for elision
>>  > enabled kernels"
>>  > (https://www.sourceware.org/ml/libc-alpha/2013-06/msg01145.html),
>>  > the tests tst-mutex5/8 are changed in order to not check some
>>  > behaviour of POSIX if lock elision is enabled at configure time.
>>  > Currently, the timeout of pthread_mutex_timedlock is only tested
>>  > with elision enabled at configure time and not for the default case.
>>
>> If it works with elision we can actually drop the ifdef,
>> as it should work in both cases.
>>
>> May have been a left over from before trylock aborted.
>>
>> -Andi
>>
>>  >
>>  > Bye
>>  >
>>  > ---
>>  > 2014-04-04  Stefan Liebler  <stli@linux.vnet.ibm.com>
>>  >
>>  >     * nptl/tst-mutex5 (do_test):
>>  >     Use #ifndef ENABLE_LOCK_ELISION instead of #ifdef.
>>  > ---
>>
>>  > diff --git a/nptl/tst-mutex5.c b/nptl/tst-mutex5.c
>>  > index 14d3025..a829272 100644
>>  > --- a/nptl/tst-mutex5.c
>>  > +++ b/nptl/tst-mutex5.c
>>  > @@ -87,7 +87,7 @@ do_test (void)
>>  >      }
>>  >
>>  >    /* Elided locks do not time out.  */
>>  > -#ifdef ENABLE_LOCK_ELISION
>>  > +#ifndef ENABLE_LOCK_ELISION
>>  >    if (pthread_mutex_trylock (&m) == 0)
>>  >      {
>>  >        puts ("mutex_trylock succeeded");
>>
>>
>> -- ak@linux.intel.com -- Speaking for myself only
>
>
>
Stefan Liebler April 30, 2014, 2:33 p.m. UTC | #3
ping

On 04/23/2014 01:30 PM, Stefan Liebler wrote:
> ping
> On 04/14/2014 09:04 AM, Stefan Liebler wrote:
>> ping.
>>
>> ok to commit?
>>
>> On 04/07/2014 04:03 PM, Stefan Liebler wrote:
>>> Hi,
>>> according to the comment of Andi Kleen (see below),
>>> i´ve dropped the ifdef.
>>> Please test it on an intel machine with lock elision support!
>>>
>>> Bye
>>>
>>> ---
>>> 2014-04-07  Stefan Liebler  <stli@linux.vnet.ibm.com>
>>>
>>>      * nptl/tst-mutex5 (do_test):
>>>      Remove #ifdef ENABLE_LOCK_ELISION.
>>> ---
>>>
>>> On Fri, Apr 04, 2014 at 01:52:18PM +0200, Stefan Liebler wrote:
>>>  > Hi,
>>>  >
>>>  > according to the comment in
>>>  > "Re: [PATCH 03/14] Add minimal test suite changes for elision
>>>  > enabled kernels"
>>>  > (https://www.sourceware.org/ml/libc-alpha/2013-06/msg01145.html),
>>>  > the tests tst-mutex5/8 are changed in order to not check some
>>>  > behaviour of POSIX if lock elision is enabled at configure time.
>>>  > Currently, the timeout of pthread_mutex_timedlock is only tested
>>>  > with elision enabled at configure time and not for the default case.
>>>
>>> If it works with elision we can actually drop the ifdef,
>>> as it should work in both cases.
>>>
>>> May have been a left over from before trylock aborted.
>>>
>>> -Andi
>>>
>>>  >
>>>  > Bye
>>>  >
>>>  > ---
>>>  > 2014-04-04  Stefan Liebler  <stli@linux.vnet.ibm.com>
>>>  >
>>>  >     * nptl/tst-mutex5 (do_test):
>>>  >     Use #ifndef ENABLE_LOCK_ELISION instead of #ifdef.
>>>  > ---
>>>
>>>  > diff --git a/nptl/tst-mutex5.c b/nptl/tst-mutex5.c
>>>  > index 14d3025..a829272 100644
>>>  > --- a/nptl/tst-mutex5.c
>>>  > +++ b/nptl/tst-mutex5.c
>>>  > @@ -87,7 +87,7 @@ do_test (void)
>>>  >      }
>>>  >
>>>  >    /* Elided locks do not time out.  */
>>>  > -#ifdef ENABLE_LOCK_ELISION
>>>  > +#ifndef ENABLE_LOCK_ELISION
>>>  >    if (pthread_mutex_trylock (&m) == 0)
>>>  >      {
>>>  >        puts ("mutex_trylock succeeded");
>>>
>>>
>>> -- ak@linux.intel.com -- Speaking for myself only
>>
>>
>>
>
>
>
Torvald Riegel Dec. 15, 2014, 9:20 p.m. UTC | #4
On Mon, 2014-04-07 at 16:03 +0200, Stefan Liebler wrote:
> Hi,
> according to the comment of Andi Kleen (see below),
> i´ve dropped the ifdef.
> Please test it on an intel machine with lock elision support!

I have committed this patch for you as
7f786dc12bd60f0a134e538429fef98350e4c814.  The part of the test that was
previously disabled if elision was enabled was black box testing
according of semantics required by POSIX.  Using lock elision must not
change the outcome.

This also fixes a -Werror with a recent GCC build, in that in a build
that enables elision, the timespec values ts, tv, and tv2 had been
declared but not used (the only use was in the disabled part of the
tests).

Thanks.

> Bye
> 
> ---
> 2014-04-07  Stefan Liebler  <stli@linux.vnet.ibm.com>
> 
> 	* nptl/tst-mutex5 (do_test):
> 	Remove #ifdef ENABLE_LOCK_ELISION.
> ---
> 
> On Fri, Apr 04, 2014 at 01:52:18PM +0200, Stefan Liebler wrote:
>  > Hi,
>  >
>  > according to the comment in
>  > "Re: [PATCH 03/14] Add minimal test suite changes for elision
>  > enabled kernels"
>  > (https://www.sourceware.org/ml/libc-alpha/2013-06/msg01145.html),
>  > the tests tst-mutex5/8 are changed in order to not check some
>  > behaviour of POSIX if lock elision is enabled at configure time.
>  > Currently, the timeout of pthread_mutex_timedlock is only tested
>  > with elision enabled at configure time and not for the default case.
> 
> If it works with elision we can actually drop the ifdef,
> as it should work in both cases.
> 
> May have been a left over from before trylock aborted.
> 
> -Andi
> 
>  >
>  > Bye
>  >
>  > ---
>  > 2014-04-04  Stefan Liebler  <stli@linux.vnet.ibm.com>
>  >
>  > 	* nptl/tst-mutex5 (do_test):
>  > 	Use #ifndef ENABLE_LOCK_ELISION instead of #ifdef.
>  > ---
> 
>  > diff --git a/nptl/tst-mutex5.c b/nptl/tst-mutex5.c
>  > index 14d3025..a829272 100644
>  > --- a/nptl/tst-mutex5.c
>  > +++ b/nptl/tst-mutex5.c
>  > @@ -87,7 +87,7 @@ do_test (void)
>  >      }
>  >
>  >    /* Elided locks do not time out.  */
>  > -#ifdef ENABLE_LOCK_ELISION
>  > +#ifndef ENABLE_LOCK_ELISION
>  >    if (pthread_mutex_trylock (&m) == 0)
>  >      {
>  >        puts ("mutex_trylock succeeded");
> 
> 
> -- ak@linux.intel.com -- Speaking for myself only
diff mbox

Patch

diff --git a/nptl/tst-mutex5.c b/nptl/tst-mutex5.c
index 14d3025..6988840 100644
--- a/nptl/tst-mutex5.c
+++ b/nptl/tst-mutex5.c
@@ -86,8 +86,6 @@  do_test (void)
       return 1;
     }
 
-  /* Elided locks do not time out.  */
-#ifdef ENABLE_LOCK_ELISION
   if (pthread_mutex_trylock (&m) == 0)
     {
       puts ("mutex_trylock succeeded");
@@ -183,7 +181,6 @@  do_test (void)
       puts ("3rd timedlock didn't return right away");
       return 1;
     }
-#endif
 
   if (pthread_mutex_unlock (&m) != 0)
     {