This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] TLS_DTV_AT_TP - Don't claim struct pthread twice


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]