Re: [HACKERS] Re: [PATCHES] S_LOCK reduced contention through backoff patch

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Re: [PATCHES] S_LOCK reduced contention through backoff patch
Дата
Msg-id 199804300421.AAA03789@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Re: [PATCHES] S_LOCK reduced contention through backoff patch  (ocie@paracel.com)
Список pgsql-hackers
>
> David Gould wrote:
>
> [snip]
> > Here is the Spinlock back off patch I promised. This does semi-random
> > backoff using select() to lessen throughput degradation due to spinlock
> > contention with large numbers of runnable backends.
>
> Does this actually use some sort of random number generator?  I'm
> thinking that this may not be entirely necessary.  With Ethernet, this
> is needed to avoid another colission, but with locks, one process is
> guaranteed to get a lock.

From the patch.  Looks very good to me.

!  * Each time we busy spin we select the next element of this array as the
!  * number of microseconds to wait. This accomplishes pseudo random back-off.
!  * Values are not critical and are weighted to the low end of the range. They
!  * were chosen to work even with different select() timer resolutions on
!  * different platforms.
!  * note: total time to cycle through all 16 entries might be about .1 second.
!  */
! int                   s_spincycle[S_NSPINCYCLE] =
! {0, 0, 0, 1000, 5000, 0, 10000, 3000,
!  0, 10000, 0, 15000, 9000, 21000, 6000, 30000
! };

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

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

Предыдущее
От: ocie@paracel.com
Дата:
Сообщение: Re: [HACKERS] Re: [PATCHES] S_LOCK reduced contention through backoff patch
Следующее
От: dg@illustra.com (David Gould)
Дата:
Сообщение: Re: [HACKERS] removing the exec() from doexec()