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

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: [PATCH] Improve spinlock inline assembly for x86.
Дата
Msg-id CACjxUsN7_fDQOxRGZ-a1N37k8Y21KEXegHRzbxvroU82B+T8=g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Improve spinlock inline assembly for x86.  (Andres Freund <andres@anarazel.de>)
Ответы Re: [PATCH] Improve spinlock inline assembly for x86.  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Mon, Jan 18, 2016 at 3:04 PM, Andres Freund <andres@anarazel.de> wrote:
> On January 18, 2016 7:27:59 PM GMT+01:00, Robert Haas <robertmhaas@gmail.com> wrote:
>> On Sun, Jan 17, 2016 at 6:38 AM, Andreas Seltenreich <seltenreich@gmx.de> wrote:

>>> 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.

>> 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

>> So I guess it would be safe to change this.  Scares me slightly,
>> though.
>
> Clobbers IIRC are implicit on x86 anyway. Rather doubt that the
> space for the prefix makes any sorry of practical difference, but
> there indeed seems no reason to have it.

I took a look at this and agree that the shorter, simpler code
proposed in this patch should make no *logical* difference, and
looks like it *should* have a neutral or beneficial affect; but
performance tuning in general, and spinlock performance in
particular, is full of surprises.  We have seen customers suffer
poor scaling on their brand new monster machines because of the
interaction between NUMA scheduling and our spinlock
implementation, and seen those problems go away with an upgrade
from pre-3.8 to post-3.8 kernels.  I would be hesitant to accept
this change without seeing a benchmark on a large NUMA machine with
4 or more memory nodes, on Linux kernels both before and after 3.8,
to make sure that the effects are at least neutral.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Fwd: [JDBC] Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102