Re: Wierd context-switching issue on Xeon

Поиск
Список
Период
Сортировка
От Kenneth Marshall
Тема Re: Wierd context-switching issue on Xeon
Дата
Msg-id 20040421220231.GA18010@it.is.rice.edu
обсуждение исходный текст
Ответ на Re: Wierd context-switching issue on Xeon  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On Wed, Apr 21, 2004 at 02:51:31PM -0400, Tom Lane wrote:
> The context swap storm is happening because of contention at the next
> level up (LWLocks rather than spinlocks).  It could be an independent
> issue that just happens to be triggered by the same sort of access
> pattern.  I put forward a hypothesis that the cache miss storm caused by
> the test-and-set ops induces the context swap storm by making the code
> more likely to be executing in certain places at certain times ... but
> it's only a hypothesis.
>
If the context swap storm derives from LWLock contention, maybe using
a random order to assign buffer locks in buf_init.c would prevent
simple adjacency of buffer allocation to cause the storm. Just offsetting
the assignment by the cacheline size should work. I notice that when
initializing the buffers in shared memory, both the buf->meta_data_lock
and the buf->cntx_lock are immediately adjacent in memory. I am not
familiar enough with the flow through postgres to see if there could
be "fighting" for those two locks. If so, offsetting those by the cache
line size would also stop the context swap storm.

--Ken

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

Предыдущее
От: brad-pgperf@duttonbros.com
Дата:
Сообщение: index usage
Следующее
От: CoL
Дата:
Сообщение: Re: Looking for ideas on how to speed up warehouse loading