Re: Use PGAlignedBlock instead of "char buf[BLCKSZ]" in more places

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Use PGAlignedBlock instead of "char buf[BLCKSZ]" in more places
Дата
Msg-id ZW1ntWPTT7EXKNP5@paquier.xyz
обсуждение исходный текст
Ответ на Use PGAlignedBlock instead of "char buf[BLCKSZ]" in more places  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: Use PGAlignedBlock instead of "char buf[BLCKSZ]" in more places  (Peter Eisentraut <peter@eisentraut.org>)
Список pgsql-hackers
On Mon, Dec 04, 2023 at 06:59:13AM +0530, Bharath Rupireddy wrote:
> The commit 44cac934 replaced "char buf[BLCKSZ]" with PGAlignedBlock to
> avoid issues on alignment-picky hardware. While it replaced most of the
> instances, there are still some more left. How about we use PGAlignedBlock
> there too, something like the attached patch? A note [2] in the commit
> 44cac934 says that ensuring proper alignment makes kernel data transfers
> fasters and the left-over "char buf[BLCKSZ]" either do read() or write()
> system calls, so it might be worth to align them with PGAlignedBlock.
>
> Thoughts?

The buffers used to write the lock file and the TLI history file are
not page buffers, and this could make code readers think that these
are pages.  So I am honestly not sure if there's a point in changing
them because the current code is not incorrect, isn't it?  It looks
like 2042b3428d39 for the TLI history file and 52948169bcdd for the
lock file began using BLCKSZ because that was just a handy thing to
do, and because we know they would never get beyond that.
--
Michael

Вложения

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Remove unnecessary includes of system headers in header files
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Which parts of src/backend/nodes/print.c are used?