This is the mail archive of the libc-alpha@sourceware.cygnus.com 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]

Re: [thockin@cobaltnet.com] libc/1206: thread stack is misaligned on mips


>>>>> Richard Henderson writes:

Richard> On Fri, Jul 16, 1999 at 08:23:53AM +0200, Andreas Jaeger wrote:
>> add ' __attribute__ ((aligned(__alignof__(double)))) ' to declaration 
>> of _pthread_descr_struct in linuxthreads/internals.h.  This should be 
>> architecture safe, and "correct"

Richard> We should force at least 16-byte alignment, perhaps more.

Tim answered privatly and told me that MIPS64 needs 16 byte alignment
and suggested to use 32 bytes for better cache utilization.

I'm appending a patch following Tim's and your suggestions.

Andreas

1999-07-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* internals.h: Align _pthread_descr_struct to 32
	bytes.  We need to align it to 16 bytes for MIPS64 and 8 bytes
	for MIPS, 32 bytes might give better cache utilization.
	Reported by Tim Hockin <thockin@cobaltnet.com>, closes PR
	libc/1206.

--- linuxthreads/internals.h.~1~	Sat Jul 10 01:14:10 1999
+++ linuxthreads/internals.h	Fri Jul 16 10:30:34 1999
@@ -106,7 +106,7 @@
   size_t p_guardsize;		/* size of guard area */
   pthread_descr p_self;		/* Pointer to this structure */
   int p_nr;                     /* Index of descriptor in __pthread_handles */
-};
+} __attribute__ ((aligned(32)));
 
 /* The type of thread handles. */
 

-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

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