Re: PATCH : Generational memory allocator (was PATCH: two slab-like memory allocators)

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH : Generational memory allocator (was PATCH: two slab-like memory allocators)
Date: 2017-09-24 20:32:09
Message-ID: 224c71cc-46d3-1f5f-0447-8999b048cbd1@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Attached is an updated version of the patch, tweaking the comments.

1) I've added a section at the end of src/backend/utils/mmgr/README,
briefly explaining the alternative memory allocators we have. I don't
think we should get into too much low-level detail here, that's more
appropriate for the .c file for each context.

2) I've slightly reworded a paragraph in generation.c describing what
use cases are suitable for the memory context. It used to say:

This memory context is based on the assumption that the allocated
chunks have similar lifespan, i.e. that chunks allocated close from
each other (by time) will also be freed in close proximity, and
mostly in the same order. This is typical for various queue-like use
cases, i.e. when tuples are constructed, processed and then thrown
away.

and now it says:

This memory context is based on the assumption that the chunks are
freed roughly in the same order as they were allocated (FIFO), or in
groups with similar lifespan (generations - hence the name of the
context). This is typical for various queue-like use cases, i.e. when
tuples are constructed, processed and then thrown away.

3) I've also added a brief note into reorderbuffer.c mentioning that it
uses SlabContext and GenerationContext. As I explained, I don't think we
should include details about how we tested the patch or whatever here.

regard

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-Generational-memory-allocator-v2.patch text/x-patch 33.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2017-09-24 20:36:59 comments improvements
Previous Message Andrew Dunstan 2017-09-24 20:19:37 Re: [BUGS] BUG #14825: enum type: unsafe use?