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)
Список
Дерево обсуждения
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>
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>
Re: Vectored I/O in bulk_write.c Heikki Linnakangas <hlinnaka@iki.fi>
Re: Vectored I/O in bulk_write.c Thomas Munro <thomas.munro@gmail.com>
Re: Vectored I/O in bulk_write.c Heikki Linnakangas <hlinnaka@iki.fi>
Re: Vectored I/O in bulk_write.c Thomas Munro <thomas.munro@gmail.com>
Re: Vectored I/O in bulk_write.c Heikki Linnakangas <hlinnaka@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>
Re: Vectored I/O in bulk_write.c Andres Freund <andres@anarazel.de>
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>
Re: Vectored I/O in bulk_write.c Thomas Munro <thomas.munro@gmail.com>
Re: Vectored I/O in bulk_write.c Noah Misch <noah@leadboat.com>
On 13/03/2024 12:18, Thomas Munro wrote:
> On Wed, Mar 13, 2024 at 9:57 PM Heikki Linnakangas 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 по дате отправления