This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 07/14] Fix tst-mutexpi8
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: libc-alpha at sourceware dot org, Andi Kleen <ak at linux dot jf dot intel dot com>
- Date: Fri, 28 Jun 2013 03:59:59 -0400
- Subject: Re: [PATCH 07/14] Fix tst-mutexpi8
- References: <1372398717-16530-1-git-send-email-andi at firstfloor dot org> <1372398717-16530-8-git-send-email-andi at firstfloor dot org>
On 06/28/2013 01:51 AM, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> tst-mutexpi8 didn't actually test PI because tst-mutex8 didn't have any
> code to enable priority inheritance. Add the needed code in a ifdef.
>
> This also fixes it for lock elision because priority inheritance turns
> off elision, so we don't need to explicitely disable it.
>
> 2013-06-18 Andi Kleen <ak@linux.intel.com>
>
> * tst-mutex8.c: Check for ENABLE_PI
> * tst-mutexpi8.c: Set TYPE to PTHREAD_MUTEX_TIMED_NP.
This looks good and should go in with the first round of
non-ABI / non-API patches.
Please wait for patch #5 to get resolved.
Please wait for me to review patch #6 v2.
> ---
> nptl/tst-mutex8.c | 7 +++++++
> nptl/tst-mutexpi8.c | 1 +
> 2 files changed, 8 insertions(+)
>
> diff --git a/nptl/tst-mutex8.c b/nptl/tst-mutex8.c
> index 70b528c..f7a7bbc 100644
> --- a/nptl/tst-mutex8.c
> +++ b/nptl/tst-mutex8.c
> @@ -357,6 +357,13 @@ do_test (void)
> return 1;
> }
> #endif
> +#ifdef ENABLE_PI
> + if (pthread_mutexattr_setprotocol (&ma, PTHREAD_PRIO_INHERIT))
> + {
> + puts ("pthread_mutexattr_setprotocol2 failed");
> + return 1;
> + }
> +#endif
> puts ("check " NAME " mutex");
> int res = check_type (NAME, &ma);
> #else
> diff --git a/nptl/tst-mutexpi8.c b/nptl/tst-mutexpi8.c
> index cea6030..4aae694 100644
> --- a/nptl/tst-mutexpi8.c
> +++ b/nptl/tst-mutexpi8.c
> @@ -1,2 +1,3 @@
> +#define TYPE PTHREAD_MUTEX_TIMED_NP
> #define ENABLE_PI 1
> #include "tst-mutex8.c"
>
Cheers,
Carlos.