Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: [HACKERS] Atomics for heap_parallelscan_nextpage()
Дата
Msg-id 20170816171025.vfwywwgunldgc5fk@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: [HACKERS] Atomics for heap_parallelscan_nextpage()  (Andres Freund <andres@anarazel.de>)
Ответы Re: [HACKERS] Atomics for heap_parallelscan_nextpage()  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-hackers
Robert, Tom,


On 2017-08-16 09:55:15 -0700, Andres Freund wrote:
> > Not sure if this is your bug or if it's exposing a pre-existing
> > deficiency in the atomics code, viz, failure to ensure that
> > pg_atomic_uint64 is actually a 64-bit-aligned type.  Andres?

> I suspect it's the former.  Suspect that the shared memory that holds
> the "parallel desc" isn't properly aligned:

Or, well, a mixture of both, because it seems like a deficiency in the
shm_toc, code, rather than the atomics code.


> Afaict shm_create/shm_toc_allocate don't actually guarantee that the end
> of the toc's memory is suitably aligned.  But I didn't yet have any
> coffee, so ...

Robert, I'm not quite sure what the intended behaviour of shm_toc is wrt
alignment. I see that individual chunks are BUFFERALIGNed (both during
estimation, and allocation). But I don't see how the size of the entire
toc is aligned, which seems a requirement, given we allocate from the
end.
Seems like we'd just have to add alignment of the total size to
shm_toc_estimate()?

Greetings,

Andres Freund



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] [COMMITTERS] pgsql: Simplify plpgsql's check for simple expressions.
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] Atomics for heap_parallelscan_nextpage()