Re: Reducing Memory Consumption (aset and generation)

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Reducing Memory Consumption (aset and generation)
Дата
Msg-id CAApHDvooEmcEvR4rhiTd8Fm14HTY4zzuNisCVxe3_bpH50_vUg@mail.gmail.com
обсуждение исходный текст
Ответ на Reducing Memory Consumption (aset and generation)  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: Reducing Memory Consumption (aset and generation)  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers
On Mon, 6 Jun 2022 at 07:28, Ranier Vilela <ranier.vf@gmail.com> wrote:
> 4) 004-generation-reduces-memory-consumption-BUG.patch
> Same to the (2), but with BUG.
> It only takes a few tweaks to completely remove the field block.

> This fails with make check.
> I couldn't figure out why it doesn't work with 16 bits (struct GenerationChunk).

I think you're misunderstanding how blocks and chunks work here.  A
block can have many chunks.  You can't find the block that a chunk is
on by subtracting Generation_BLOCKHDRSZ from the pointer given to
GenerationFree(). That would only work if the chunk happened to be the
first chunk on a block. If it's anything apart from that then you'll
be making adjustments to the memory of some prior chunk on the block.
I imagine this is the reason you can't get the tests to pass.

Can you also explain why you think moving code around randomly or
adding unlikely() macros helps reduce the memory consumption overheads
of generation contexts?  I imagine you think that's helping to further
improve performance, but you've not offered any evidence of that
separately from the other changes you've made. If you think those are
useful changes then I recommend you run individual benchmarks and
offer those as proof that those changes are worthwhile.

David



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [v15 beta] pg_upgrade failed if earlier executed with -c switch
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: pg_auth_members.grantor is bunk