* [PATCH] nptl: Remove private futex optimization [BZ #27304]
@ 2021-02-01 8:46 Florian Weimer
2021-02-01 9:24 ` Andreas Schwab
2021-02-03 20:10 ` Adhemerval Zanella
0 siblings, 2 replies; 4+ messages in thread
From: Florian Weimer @ 2021-02-01 8:46 UTC (permalink / raw)
To: libc-alpha
It is effectively used, except for pthread_cond_destroy, where we do
not want it; see bug 27304. The internal locks do not support a
process-shared mode.
This fixes commit dc6cfdc934db9997c33728082d63552b9eee4563 ("nptl:
Move pthread_cond_destroy implementation into libc").
Tested on i686-linux-gnu and x86_64-linux-gnu. This is for glib 2.34,
although I intend to backport it to 2.32 and 2.33 because it looks like
it might be a regression.
---
sysdeps/nptl/lowlevellock-futex.h | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/sysdeps/nptl/lowlevellock-futex.h b/sysdeps/nptl/lowlevellock-futex.h
index ecb729da6b..ca96397a4a 100644
--- a/sysdeps/nptl/lowlevellock-futex.h
+++ b/sysdeps/nptl/lowlevellock-futex.h
@@ -50,20 +50,8 @@
#define LLL_SHARED FUTEX_PRIVATE_FLAG
#ifndef __ASSEMBLER__
-
-# if IS_IN (libc) || IS_IN (rtld)
-/* In libc.so or ld.so all futexes are private. */
-# define __lll_private_flag(fl, private) \
- ({ \
- /* Prevent warnings in callers of this macro. */ \
- int __lll_private_flag_priv __attribute__ ((unused)); \
- __lll_private_flag_priv = (private); \
- ((fl) | FUTEX_PRIVATE_FLAG); \
- })
-# else
-# define __lll_private_flag(fl, private) \
+# define __lll_private_flag(fl, private) \
(((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
-# endif
# define lll_futex_syscall(nargs, futexp, op, ...) \
({ \
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nptl: Remove private futex optimization [BZ #27304]
2021-02-01 8:46 [PATCH] nptl: Remove private futex optimization [BZ #27304] Florian Weimer
@ 2021-02-01 9:24 ` Andreas Schwab
2021-02-01 9:25 ` Florian Weimer
2021-02-03 20:10 ` Adhemerval Zanella
1 sibling, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2021-02-01 9:24 UTC (permalink / raw)
To: Florian Weimer via Libc-alpha; +Cc: Florian Weimer
On Feb 01 2021, Florian Weimer via Libc-alpha wrote:
> It is effectively used,
unused?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nptl: Remove private futex optimization [BZ #27304]
2021-02-01 9:24 ` Andreas Schwab
@ 2021-02-01 9:25 ` Florian Weimer
0 siblings, 0 replies; 4+ messages in thread
From: Florian Weimer @ 2021-02-01 9:25 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Florian Weimer via Libc-alpha
* Andreas Schwab:
> On Feb 01 2021, Florian Weimer via Libc-alpha wrote:
>
>> It is effectively used,
>
> unused?
Right, fixed. Thanks.
Florian
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nptl: Remove private futex optimization [BZ #27304]
2021-02-01 8:46 [PATCH] nptl: Remove private futex optimization [BZ #27304] Florian Weimer
2021-02-01 9:24 ` Andreas Schwab
@ 2021-02-03 20:10 ` Adhemerval Zanella
1 sibling, 0 replies; 4+ messages in thread
From: Adhemerval Zanella @ 2021-02-03 20:10 UTC (permalink / raw)
To: libc-alpha
On 01/02/2021 05:46, Florian Weimer via Libc-alpha wrote:
> It is effectively used, except for pthread_cond_destroy, where we do
> not want it; see bug 27304. The internal locks do not support a
> process-shared mode.
>
> This fixes commit dc6cfdc934db9997c33728082d63552b9eee4563 ("nptl:
> Move pthread_cond_destroy implementation into libc").
>
> Tested on i686-linux-gnu and x86_64-linux-gnu. This is for glib 2.34,
> although I intend to backport it to 2.32 and 2.33 because it looks like
> it might be a regression.
The lll_futex_wake is used on THREAD_GSCOPE_RESET_FLAG, but it already
uses LLL_PRIVATE on all architectures.
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
>
> ---
> sysdeps/nptl/lowlevellock-futex.h | 14 +-------------
> 1 file changed, 1 insertion(+), 13 deletions(-)
>
> diff --git a/sysdeps/nptl/lowlevellock-futex.h b/sysdeps/nptl/lowlevellock-futex.h
> index ecb729da6b..ca96397a4a 100644
> --- a/sysdeps/nptl/lowlevellock-futex.h
> +++ b/sysdeps/nptl/lowlevellock-futex.h
> @@ -50,20 +50,8 @@
> #define LLL_SHARED FUTEX_PRIVATE_FLAG
>
> #ifndef __ASSEMBLER__
> -
> -# if IS_IN (libc) || IS_IN (rtld)
> -/* In libc.so or ld.so all futexes are private. */
> -# define __lll_private_flag(fl, private) \
> - ({ \
> - /* Prevent warnings in callers of this macro. */ \
> - int __lll_private_flag_priv __attribute__ ((unused)); \
> - __lll_private_flag_priv = (private); \
> - ((fl) | FUTEX_PRIVATE_FLAG); \
> - })
> -# else
> -# define __lll_private_flag(fl, private) \
> +# define __lll_private_flag(fl, private) \
> (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
> -# endif
>
> # define lll_futex_syscall(nargs, futexp, op, ...) \
> ({ \
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-03 20:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 8:46 [PATCH] nptl: Remove private futex optimization [BZ #27304] Florian Weimer
2021-02-01 9:24 ` Andreas Schwab
2021-02-01 9:25 ` Florian Weimer
2021-02-03 20:10 ` Adhemerval Zanella
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).