Re: Shared memory size computation oversight?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Shared memory size computation oversight?
Дата
Msg-id da2a9fd1-b135-5dc4-ff5d-3e3447a6b3c9@enterprisedb.com
обсуждение исходный текст
Ответы Re: Shared memory size computation oversight?  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-hackers
On 27.02.21 09:08, Julien Rouhaud wrote:
> PFA a patch that fixes pg_prewarm and pg_stat_statements explicit alignment to
> CACHELINEALIGN, and also update the alignment in hash_estimate_size() to what I
> think ShmemInitHash will actually consume.

For extensions, wouldn't it make things better if 
RequestAddinShmemSpace() applied CACHELINEALIGN() to its argument?

If you consider the typical sequence of RequestAddinShmemSpace(mysize()) 
and later ShmemInitStruct(..., mysize(), ...), then the size gets 
rounded up to cache-line size in the second case and not the first.  The 
premise in your patch is that the extension should figure that out 
before calling RequestAddinShmemSpace(), but that seems wrong.

Btw., I think your patch was wrong to apply CACHELINEALIGN() to 
intermediate results rather than at the end.



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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: call popcount32/64 directly on non-x86 platforms
Следующее
От: John Naylor
Дата:
Сообщение: Re: call popcount32/64 directly on non-x86 platforms