Re: Vectored I/O in bulk_write.c

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Vectored I/O in bulk_write.c
Дата
Msg-id f7e023ff-7621-41d0-97bb-a60a9ab08909@iki.fi
обсуждение исходный текст
Ответ на Re: Vectored I/O in bulk_write.c  (Thomas Munro <thomas.munro@gmail.com>)
Ответы Re: Vectored I/O in bulk_write.c  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
On 13/03/2024 12:18, Thomas Munro wrote:
> On Wed, Mar 13, 2024 at 9:57 PM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>>> Here also is a first attempt at improving the memory allocation and
>>> memory layout.
>>> ...
>>> +typedef union BufferSlot
>>> +{
>>> +     PGIOAlignedBlock buffer;
>>> +     dlist_node      freelist_node;
>>> +}                    BufferSlot;
>>> +
>>
>> If you allocated the buffers in one large contiguous chunk, you could
>> often do one large write() instead of a gathered writev() of multiple
>> blocks. That should be even better, although I don't know much of a
>> difference it makes. The above layout wastes a fair amount memory too,
>> because 'buffer' is I/O aligned.
> 
> The patch I posted has an array of buffers with the properties you
> describe, so you get a pwrite() (no 'v') sometimes, and a pwritev()
> with a small iovcnt when it wraps around:

Oh I missed that it was "union BufferSlot". I thought it was a struct. 
Never mind then.

-- 
Heikki Linnakangas
Neon (https://neon.tech)




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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Vectored I/O in bulk_write.c
Следующее
От: John Naylor
Дата:
Сообщение: Re: [PoC] Improve dead tuple storage for lazy vacuum