This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] TLS_DTV_AT_TP - Don't claim struct pthread twice
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: "Carlos O'Donell" <carlos at systemhalted dot org>, GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Sat, 11 May 2013 11:17:17 -0400
- Subject: Re: [PATCH] TLS_DTV_AT_TP - Don't claim struct pthread twice
- References: <518E176D dot 4020708 at mentor dot com>
On 05/11/2013 06:03 AM, Tom de Vries wrote:
> Carlos,
>
> For TLS_DTV_AT_TP architectures, the initialization of stacktop to
> (char *) (pd - 1) in allocate_stack claims unused space the size of struct
> pthread. The space used for struct pthread is pointed to by pd.
>
> This patch removes the claiming of unused space.
>
> I tested the patch on MIPS qemu (mips-linux-gnu) with host i686-pc-linux-gnu, no
> issues found.
>
> OK to apply?
No. You need to more clearly describe why you think this is wrong.
I'm familiar with this code and I've not seen any technical
defects in it, other than perhaps excessive rounding and padding
of the space used by the stack.
> 2013-05-10 Tom de Vries <tom@codesourcery.com>
>
> * allocatestack.c [TLS_DTV_AT_TP] (allocate_stack): Don't claim struct
> pthread twice.
>
>
> glibc-claim-less-stack.patch
>
>
> diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
> index 56bf257..a4efaa3 100644
> --- a/nptl/allocatestack.c
> +++ b/nptl/allocatestack.c
> @@ -714,7 +714,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
> /* The stack begins before the TCB and the static TLS block. */
> stacktop = ((char *) (pd + 1) - __static_tls_size);
> #elif TLS_DTV_AT_TP
> - stacktop = (char *) (pd - 1);
> + stacktop = (char *) pd;
> #endif
>
> #ifdef NEED_SEPARATE_REGISTER_STACK
Cheers,
Carlos.