Re: Wierd context-switching issue on Xeon

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Wierd context-switching issue on Xeon
Дата
Msg-id 14056.1082341808@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Wierd context-switching issue on Xeon  (Greg Stark <gsstark@mit.edu>)
Список pgsql-performance
Greg Stark <gsstark@mit.edu> writes:
> There's nothing about the way Postgres spinlocks are coded that affects this?

No.  AFAICS our spinlock sequences are pretty much equivalent to the way
the Linux kernel codes its spinlocks, so there's no deep dark knowledge
to be mined there.

We could possibly use some more-efficient blocking mechanism than semop()
once we've decided we have to block (it's a shame Linux still doesn't
have cross-process POSIX semaphores).  But the striking thing I learned
from looking at the oprofile results is that most of the inefficiency
comes at the very first TAS() operation, before we've even "spun" let
alone decided we have to block.  The s_lock() subroutine does not
account for more than a few percent of the runtime in these tests,
compared to 15% at the inline TAS() operations in LWLockAcquire and
LWLockRelease.  I interpret this to mean that once it's acquired
ownership of the cache line, a Xeon can get through the "spinning"
loop in s_lock() mighty quickly.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Wierd context-switching issue on Xeon
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Horribly slow hash join