Обсуждение: Stuck Spinlock (fwd) - m68k architecture, 7.0.3

Поиск
Список
Период
Сортировка

Stuck Spinlock (fwd) - m68k architecture, 7.0.3

От
"Oliver Elphick"
Дата:
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.

------- Forwarded Message

Date:    Mon, 05 Feb 2001 09:03:21 -0500
From:    Russell Hires <rhires@earthlink.net>
To:      Oliver.Elphick@lfix.co.uk
Subject: Stuck Spinlock

Hey, here is the spinlock test results...

Thanks!

Russell


rusty@smurfette:~/postgresql-7.0.3/src/backend/storage/buffer$ make
s_lock_test
gcc -I../../../include -I../../../backend   -O2 -g -g3 -Wall
- -Wmissing-prototypes -Wmissing-declarations -I../.. -DS_LOCK_TEST=1 s_lock.c
- -o s_lock_test
s_lock.c:251: warning: return type of `main' is not `int'
./s_lock_test

FATAL: s_lock(80002974) at s_lock.c:260, stuck spinlock. Aborting.

FATAL: s_lock(80002974) at s_lock.c:260, stuck spinlock. Aborting.
make: *** [s_lock_test] Aborted
make: *** Deleting file `s_lock_test'




------- End of Forwarded Message


--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Lift up your heads, O ye gates; and be ye lift up, ye
      everlasting doors; and the King of glory shall come
      in. Who is this King of glory? The LORD strong and
      mighty, the LORD mighty in battle."
                                   Psalms 24:7,8



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

От
Tom Lane
Дата:
"Oliver Elphick" <olly@lfix.co.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