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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Stuck Spinlock (fwd) - m68k architecture, 7.0.3
Дата
Msg-id 16166.981386796@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Stuck Spinlock (fwd) - m68k architecture, 7.0.3  ("Oliver Elphick" <olly@lfix.co.uk>)
Список pgsql-hackers
"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

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

Предыдущее
От: Mathieu Dube
Дата:
Сообщение: 1024 limits??
Следующее
От: Mathieu Dube
Дата:
Сообщение: Re: 1024 limits??