Re: Misaligned BufferDescriptors causing major performance problems on AMD

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Misaligned BufferDescriptors causing major performance problems on AMD
Дата
Msg-id CAM-w4HMSmKR0mhsu9Hr1gse92MfhDYPxVt6Tn+48h6iH03hEUQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Re: Misaligned BufferDescriptors causing major performance problems on AMD  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Misaligned BufferDescriptors causing major performance problems on AMD  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
On Wed, Feb 5, 2014 at 3:57 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Maybe, or maybe not, but I think it does say that we should be very wary
> of proposals to force data structure alignment without any testing of the
> consequences.


Sure. see for instance
http://igoro.com/archive/gallery-of-processor-cache-effects/

From what I understand what Andres is suggesting is ensuring that each
BufferDescriptor is sitting entirely in one cache line. That seems
very unlikely to be worse than having a BufferDescriptor spanning two
cache lines and being on the same cache line as the adjacent
BufferDescriptors. But this all depends on knowing the length of the
cache lines. I see a lot of confusion online over whether cache lines
are 64 bytes, 128 bytes, or other length even just on Intel
architectures, let alone others.

I wonder if there are any generic tools to optimize array/structure
layouts based on cachegrind profiling or something like that. Then we
wouldn't need to know the oddities ourselves and optimize manually. We
could maybe even do it on the build farm and select the right profile
at build time by matching build target information.

-- 
greg



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Re: Misaligned BufferDescriptors causing major performance problems on AMD
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Performance Improvement by reducing WAL for Update Operation