From: Carlos O'Donell <carlos@redhat.com>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH 06/13] nptl: Eliminate __pthread_multiple_threads
Date: Sun, 9 May 2021 17:42:38 -0400 [thread overview]
Message-ID: <1c18151f-30ee-c2d5-898b-12c3aa158c40@redhat.com> (raw)
In-Reply-To: <831eb2a40a5afc5ed198da0f5252efe9a50d9c2b.1620323953.git.fweimer@redhat.com>
On 5/6/21 2:10 PM, Florian Weimer via Libc-alpha wrote:
> It is no longer needed after the SINGLE_THREADED_P consolidation.
Yup. LGTM.
Tested on x86_64 and i686 without regression.
Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
> ---
> nptl/allocatestack.c | 4 ++--
> nptl/pthreadP.h | 7 -------
> nptl/pthread_cancel.c | 2 +-
> nptl/vars.c | 7 -------
> 4 files changed, 3 insertions(+), 17 deletions(-)
>
> diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
> index 059786192e..88c49f8154 100644
> --- a/nptl/allocatestack.c
> +++ b/nptl/allocatestack.c
> @@ -477,7 +477,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
> /* This is at least the second thread. */
> pd->header.multiple_threads = 1;
> #ifndef TLS_MULTIPLE_THREADS_IN_TCB
> - __pthread_multiple_threads = __libc_multiple_threads = 1;
> + __libc_multiple_threads = 1;
> #endif
>
> #ifdef NEED_DL_SYSINFO
> @@ -598,7 +598,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
> /* This is at least the second thread. */
> pd->header.multiple_threads = 1;
> #ifndef TLS_MULTIPLE_THREADS_IN_TCB
> - __pthread_multiple_threads = __libc_multiple_threads = 1;
> + __libc_multiple_threads = 1;
> #endif
>
> #ifdef NEED_DL_SYSINFO
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index dd6d6c6342..8ab247f977 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -370,13 +370,6 @@ extern unsigned long int *__fork_generation_pointer attribute_hidden;
> /* Register the generation counter in the libpthread with the libc. */
> extern void __libc_pthread_init (void (*reclaim) (void));
>
> -#ifndef TLS_MULTIPLE_THREADS_IN_TCB
> -/* Variable set to a nonzero value either if more than one thread runs or ran,
> - or if a single-threaded process is trying to cancel itself. See
> - nptl/descr.h for more context on the single-threaded process case. */
> -extern int __pthread_multiple_threads attribute_hidden;
> -#endif
> -
> extern size_t __pthread_get_minstack (const pthread_attr_t *attr);
>
> /* Namespace save aliases. */
> diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c
> index 2cab8f0a34..fd04bedf6c 100644
> --- a/nptl/pthread_cancel.c
> +++ b/nptl/pthread_cancel.c
> @@ -90,7 +90,7 @@ __pthread_cancel (pthread_t th)
> points get executed. */
> THREAD_SETMEM (THREAD_SELF, header.multiple_threads, 1);
> #ifndef TLS_MULTIPLE_THREADS_IN_TCB
> - __pthread_multiple_threads = __libc_multiple_threads = 1;
> + __libc_multiple_threads = 1;
> #endif
> }
> /* Mark the thread as canceled. This has to be done
> diff --git a/nptl/vars.c b/nptl/vars.c
> index 8de30856b8..03a6cc84be 100644
> --- a/nptl/vars.c
> +++ b/nptl/vars.c
> @@ -26,10 +26,3 @@ union pthread_attr_transparent __default_pthread_attr attribute_hidden;
>
> /* Mutex protecting __default_pthread_attr. */
> int __default_pthread_attr_lock = LLL_LOCK_INITIALIZER;
> -
> -#ifndef TLS_MULTIPLE_THREADS_IN_TCB
> -/* Variable set to a nonzero value either if more than one thread runs or ran,
> - or if a single-threaded process is trying to cancel itself. See
> - nptl/descr.h for more context on the single-threaded process case. */
> -int __pthread_multiple_threads attribute_hidden;
> -#endif
>
--
Cheers,
Carlos.
next prev parent reply other threads:[~2021-05-09 21:42 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-06 18:08 [PATCH 00/13] Linux: Move most stack management out of libpthread Florian Weimer
2021-05-06 18:08 ` [PATCH 01/13] scripts/versions.awk: Add strings and hashes to <first-versions.h> Florian Weimer
2021-05-09 21:42 ` Carlos O'Donell
2021-05-06 18:09 ` [PATCH v2 02/13] elf, nptl: Resolve recursive lock implementation early Florian Weimer
2021-05-09 21:42 ` Carlos O'Donell
2021-05-10 5:54 ` Florian Weimer
2021-05-06 18:10 ` [PATCH 03/13] nptl: Export __libc_multiple_threads from libc as an internal symbol Florian Weimer
2021-05-09 21:42 ` Carlos O'Donell
2021-05-06 18:10 ` [PATCH 04/13] Linux: Explicitly disable cancellation checking in the dynamic loader Florian Weimer
2021-05-09 21:42 ` Carlos O'Donell
2021-05-06 18:10 ` [PATCH 05/13] Linux: Simplify and fix the definition of SINGLE_THREAD_P Florian Weimer
2021-05-09 21:42 ` Carlos O'Donell
2021-05-06 18:10 ` [PATCH 06/13] nptl: Eliminate __pthread_multiple_threads Florian Weimer
2021-05-09 21:42 ` Carlos O'Donell [this message]
2021-05-06 18:10 ` [PATCH 07/13] elf: Introduce __tls_pre_init_tp Florian Weimer
2021-05-09 21:42 ` Carlos O'Donell
2021-05-06 18:10 ` [PATCH 08/13] nptl: Move more stack management variables into _rtld_global Florian Weimer
2021-05-09 21:42 ` Carlos O'Donell
2021-05-06 18:11 ` [PATCH 09/13] nptl: Simplify the change_stack_perm calling convention Florian Weimer
2021-05-09 21:42 ` Carlos O'Donell
2021-05-06 18:11 ` [PATCH 10/13] nptl: Move changing of stack permissions into ld.so Florian Weimer
2021-05-09 21:42 ` Carlos O'Donell
2021-05-06 18:11 ` [PATCH 11/13] nptl: Simplify resetting the in-flight stack in __reclaim_stacks Florian Weimer
2021-05-09 21:42 ` Carlos O'Donell
2021-05-06 18:11 ` [PATCH 12/13] nptl: Move __default_pthread_attr, __default_pthread_attr_lock into libc Florian Weimer
2021-05-09 21:41 ` Carlos O'Donell
2021-05-09 21:42 ` Carlos O'Donell
2021-05-06 18:11 ` [PATCH 13/13] Linux: Move __reclaim_stacks into the fork implementation in libc Florian Weimer
2021-05-09 21:41 ` Carlos O'Donell
2021-05-09 21:42 ` [PATCH 00/13] Linux: Move most stack management out of libpthread Carlos O'Donell
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=1c18151f-30ee-c2d5-898b-12c3aa158c40@redhat.com \
--to=carlos@redhat.com \
--cc=fweimer@redhat.com \
--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).