Re: [PATCH] Improve spinlock inline assembly for x86.

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [PATCH] Improve spinlock inline assembly for x86.
Дата
Msg-id CA+Tgmoay6NVAag4kGPpwMSFGmE0ZNvpOgY2enAZhqNNvOyHrDA@mail.gmail.com
обсуждение исходный текст
Ответ на [PATCH] Improve spinlock inline assembly for x86.  (Andreas Seltenreich <seltenreich@gmx.de>)
Ответы Re: [PATCH] Improve spinlock inline assembly for x86.  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Sun, Jan 17, 2016 at 6:38 AM, Andreas Seltenreich <seltenreich@gmx.de> wrote:
> I'm currently experimenting with just-in-time compilation using libfirm.
> While discussing issues with its developers, it was pointed out to me
> that our spinlock inline assembly is less than optimal.  Attached is a
> patch that addresses this.
>
> ,----
> | Remove the LOCK prefix from the XCHG instruction.  Locking is implicit
> | with XCHG and the prefix wastes a byte.  Also remove the "cc" register
> | from the clobber list as the XCHG instruction does not modify any flags.
> |
> | Reported by Christoph Mallon.
> `----

I did a Google search and everybody seems to agree that the LOCK
prefix is redundant.  I found a source agreeing with the idea that it
doesn't clobber registers, too:

http://www.oopweb.com/Assembly/Documents/ArtOfAssembly/Volume/Chapter_6/CH06-1.html#HEADING1-85

So I guess it would be safe to change this.  Scares me slightly, though.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Truncating/vacuuming relations on full tablespaces
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Proposal: speeding up GIN build with parallel workers