From: Torvald Riegel <triegel@redhat.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 1/5] Consolidate sem_open implementations
Date: Mon, 05 Sep 2016 17:21:00 -0000 [thread overview]
Message-ID: <1473096093.20286.7.camel@localhost.localdomain> (raw)
In-Reply-To: <1471876053-780-1-git-send-email-adhemerval.zanella@linaro.org>
On Mon, 2016-08-22 at 11:27 -0300, Adhemerval Zanella wrote:
> Current sparc32 sem_open and default one only differ on:
>
> 1. Default one contains a 'futex_supports_pshared' check.
> 2. sem.newsem.pad is initialized to zero.
>
> This patch removes sparc32 and sparc32v9 sem_open arch specific
> implementation and instead set sparc32 to use nptl default one.
> Using 1. is fine since it should always evaluate 0 for Linux
> (an optimized away by the compiler). Adding 2. to default
> implementation should be ok since 'pad' field is used mainly
> on sparc32 code.
>
> I checked on i686 and checked a sparc32v9 build.
>
> * nptl/sem_open.c (sem_open): Init pad value to 0.
> * sysdeps/sparc/sparc32/sem_open.c: Remove file.
> * sysdeps/sparc/sparc32/sparcv9/sem_open.c: Likewise.
Can you do something similar for sem_init please?
> ---
> nptl/sem_open.c | 1 +
> sysdeps/sparc/sparc32/sem_open.c | 300 -------------------------------
> sysdeps/sparc/sparc32/sparcv9/sem_open.c | 1 -
> 4 files changed, 7 insertions(+), 301 deletions(-)
> delete mode 100644 sysdeps/sparc/sparc32/sem_open.c
> delete mode 100644 sysdeps/sparc/sparc32/sparcv9/sem_open.c
>
> diff --git a/nptl/sem_open.c b/nptl/sem_open.c
> index 911b1f3..974cff9 100644
> --- a/nptl/sem_open.c
> +++ b/nptl/sem_open.c
> @@ -207,6 +207,7 @@ sem_open (const char *name, int oflag, ...)
> sem.newsem.data = value;
> #else
> sem.newsem.value = value << SEM_VALUE_SHIFT;
> + sem.newsem.pad = 0;
> sem.newsem.nwaiters = 0;
> #endif
> /* This always is a shared semaphore. */
I think we should add a comment there, pointing to the use of .pad as a
mutex on pre-v9 sparc (same in sem_init when you consolidate this too).
Otherwise, this is OK.
next prev parent reply other threads:[~2016-09-05 17:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-22 14:27 Adhemerval Zanella
2016-08-22 14:27 ` [PATCH 2/5] nptl: Set sem_open as a non cancellation point (BZ #15765) Adhemerval Zanella
2016-09-05 17:03 ` Torvald Riegel
2016-08-22 14:27 ` [PATCH 4/5] nptl: Fix sem_wait and sem_timedwait cancellation Adhemerval Zanella
2016-09-05 18:07 ` Torvald Riegel
2016-09-09 16:32 ` Torvald Riegel
2016-09-14 20:51 ` Adhemerval Zanella
2016-08-22 14:27 ` [PATCH 5/5] rt: Set shm_open as a non cancellation point (BZ #18243) Adhemerval Zanella
2016-09-05 18:08 ` Torvald Riegel
2016-08-22 14:27 ` [PATCH 3/5] Remove sparc sem_wait Adhemerval Zanella
2016-09-05 17:24 ` Torvald Riegel
2016-09-05 17:21 ` Torvald Riegel [this message]
2016-09-14 21:39 ` [PATCH 1/5] Consolidate sem_open implementations Adhemerval Zanella
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=1473096093.20286.7.camel@localhost.localdomain \
--to=triegel@redhat.com \
--cc=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).