Re: Solaris ASM problem

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Solaris ASM problem
Дата
Msg-id 200604291158.k3TBwId09203@candle.pha.pa.us
обсуждение исходный текст
Ответ на Solaris ASM problem  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Theo Schlossnagle wrote:
> Kris Jurka wrote:
> 
> >
> >
> > On Fri, 28 Apr 2006, Theo Schlossnagle wrote:
> >
> >> Kris Jurka wrote:
> >>
> >>> Anyway the test exits with
> >>> Stuck spinlock (80618e9) detected at ./s_lock.c:355.
> >>>
> >>> on a linux gcc build this exits with
> >>> Stuck spinlock (0x5013ad) detected at ./s_lock.c:402.
> >>
> >>
> >> This seems like a different problem, no?  The patch I sent in didn't 
> >> touch any of the linux assembly bits.  The linux test should pass to 
> >> the end without an issue right?
> >>
> >
> > No, that's the desired ending.  It prints:
> >
> > S_LOCK_TEST: this will print 1000 stars and then
> >              exit with a 'stuck spinlock' message
> >              if S_LOCK() and TAS() are working.
> >
> > The solaris version is just getting stuck before at another point before
> > the expected stuck point.
> 
> I downloaded and tested this on my box.  The first thing I noticed is 
> that when compiling tas.s on Solaris 10 the -P flag was omitted (which 
> is needed to have the #ifdef's process correctly).  I did an: as -P 
> tas.s by hand and then was able to repeat your problem.

You should see in backend/port/Makfile:
       $(CC) $(CFLAGS) -c -P $<

Perhaps you didn't get that version yet.

> Looks like part of my patch wasn't applied (or I neglected to send it 
> all).  The cas operations are all word operations so the slock_t _MUST_ 
> be changed to a word.

Sorry, yes, that is my fault.  I had to modify the macro test you
defined from __amd64 to __x86_64__, and didn't see the change in the
typedef.  Fix applied.

---------------------------------------------------------------------------


> 
> In src/include/storage/s_lock.h in the sun section, the slock_t must be 
> an unsigned int:
> 
> ; cvs diff -u src/include/storage/s_lock.h
> Index: src/include/storage/s_lock.h
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/include/storage/s_lock.h,v
> retrieving revision 1.151
> diff -u -r1.151 s_lock.h
> --- src/include/storage/s_lock.h        28 Apr 2006 03:43:19 -0000      
> 1.151
> +++ src/include/storage/s_lock.h        29 Apr 2006 02:48:45 -0000
> @@ -765,7 +765,7 @@
>  
>  #if defined(__sun) && (defined(__i386) || defined(__x86_64__) || 
> defined(__sparc__) || defined(__sparc))
>  #define HAS_TEST_AND_SET
> -typedef unsigned char slock_t;
> +typedef unsigned int slock_t;
>  
>  extern slock_t pg_atomic_cas(volatile slock_t *lock, slock_t with,
>                                                                           
> slock_t cmp);
> 
> 

--  Bruce Momjian   http://candle.pha.pa.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Exports from postgres
Следующее
От: Thomas Hallgren
Дата:
Сообщение: stdout when running as a Windows service