Changing types of block and chunk sizes in memory contexts - Mailing list pgsql-hackers

From Melih Mutlu
Subject Changing types of block and chunk sizes in memory contexts
Date
Msg-id CAGPVpCSOW3uJ1QJmsMR9_oE3X7fG_z4q0AoU4R_w+2RzvroPFg@mail.gmail.com
Whole thread Raw
Responses Re: Changing types of block and chunk sizes in memory contexts
List pgsql-hackers
Hi hackers,

In memory contexts, block and chunk sizes are likely to be limited by
some upper bounds. Some examples of those bounds can be
MEMORYCHUNK_MAX_BLOCKOFFSET and MEMORYCHUNK_MAX_VALUE. Both values are
only 1 less than 1GB.
This makes memory contexts to have blocks/chunks with sizes less than
1GB. Such sizes can be stored in 32-bits. Currently, "Size" type,
which is 64-bit, is used, but 32-bit integers should be enough to
store any value less than 1GB.

Attached patch is an attempt to change the types of some fields to
uint32 from Size in aset, slab and generation memory contexts.
I tried to find most of the places that needed to be changed to
uint32, but I probably missed some. I can add more places if you feel
like it.

I would appreciate any feedback.

Thanks,
-- 
Melih Mutlu
Microsoft

Attachment

pgsql-hackers by date:

Previous
From: Yugo NAGATA
Date:
Subject: pgbnech: allow to cancel queries during benchmark
Next
From: Tomas Vondra
Date:
Subject: Re: logical decoding and replication of sequences, take 2