Re: Stuck Spinlock (fwd) - m68k architecture, 7.0.3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-ports(at)postgresql(dot)org, Russell Hires <rhires(at)earthlink(dot)net>
Subject: Re: Stuck Spinlock (fwd) - m68k architecture, 7.0.3
Date: 2001-02-05 15:26:36
Message-ID: 16166.981386796@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-ports

"Oliver Elphick" <olly(at)lfix(dot)co(dot)uk> writes:
> Has anyone got PostgreSQL 7.0.3 working on m68k architecture?
> Russell is trying to install it on m68k and is consistently getting a
> stuck spinlock in initdb. He used to have 6.3.2 working. Both 6.5.3
> and 7.0.3 fail.
> His message shows that the first attempt to set a lock fails.

There was no TAS() support for m68k before 6.5, so 6.3.2 could have
"worked" only for rather small values of "work".

Just eyeballing the m68k TAS assembly code, I think it is incorrectly
assuming that the result register will start off as zeroes. Please try
the following patch in src/include/storage/s_lock.h:

static __inline__ int
tas(volatile slock_t *lock)
{
register int rv;

__asm__ __volatile__(
+ " clrl %0 \n"
" tas %1 \n"
" sne %0 \n"
: "=d"(rv), "=m"(*lock)
: "1"(*lock)
: "cc");

return rv;
}

(This is against the current CVS file; the code is formatted differently
in 6.5, but is equivalent.)

Don't forget to "make clean" and rebuild the whole backend after
applying the patch, unless you've set up proper dependency tracking.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mathieu Dube 2001-02-05 15:41:41 1024 limits??
Previous Message Culley Harrelson 2001-02-05 15:22:49 full text searching

Browse pgsql-ports by date

  From Date Subject
Next Message Bruce Momjian 2001-02-05 17:39:05 Re: IpcMemoryDetach fails under Cygwin on Win98
Previous Message Oliver Elphick 2001-02-05 14:29:33 Stuck Spinlock (fwd) - m68k architecture, 7.0.3