Re: Some interesting results from tweaking spinlocks

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Some interesting results from tweaking spinlocks
Дата
Msg-id 23177.1010286351@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Some interesting results from tweaking spinlocks  (Brent Verner <brent@rcfile.org>)
Список pgsql-hackers
Brent Verner <brent@rcfile.org> writes:
> | What I should've thought of is to try sched_yield() as well, which is
> | the operation we *really* want here, and it is available on this version
> | of Linux.  Off to run another batch of tests ...

> yes.  using just sched_yield() inside the TAS loop appears to give
> better performance on both freebsd and linux (single-proc); in
> particular, it _looks_ like there is a 8-10% performance gain at
> 32 clients.

I'm noticing more variability in the results today than I got yesterday;
this is odd, since the only change in the system environment is that we
cleaned off some more free space on the disk drive array in preparation
for running larger benchmarks.  An example of the variability can be
seen by comparing the two "yield spins 100" curves below, which should
be identical circumstances.  Still, it's clear that using sched_yield
is a win.

Also note that spins=1000 seems to be a loser compared to spins=100 when
using sched_yield, while it is not with either select or usleep.  This
makes sense, since the reason for not wanting to yield the processor
is the large delay till we can run again.  With sched_yield that penalty
is eliminated.

            regards, tom lane


Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Some interesting results from tweaking spinlocks
Следующее
От: mlw
Дата:
Сообщение: pgbench, consistency?