Re: Dynamic shared memory areas

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Dynamic shared memory areas
Date: 2016-11-25 12:48:56
Message-ID: CAEepm=3AGXBu4VO0_QZS0+-X3A_p-PM1DDtVoM1D_Ognd0WUoA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 24, 2016 at 1:07 AM, Thomas Munro
<thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> The attached patch is just for discussion only... I need to resolve
> that contiguous_pages question and do some more testing.

As Dilip discovered, there was a problem with resource cleanup for DSA
areas created inside pre-existing DSM segments, which I've now sorted
out in the attached version. I also updated the copyright messages,
introduced a couple of the new 'unlikely' macros in the address
decoding path, and introduced high_segment_index to avoid scanning
bigger segment arrays than is necessary sometimes.

As for contiguous_pages_dirty, I see what was missing from earlier
attempts at more subtle invalidation: we had failed to set the flag in
cases where FreePageManagerGetInternal was called during a
FreePageManagerPut operation. What do you think about the logic in
this patch... do you see any ways for contiguous_pages to get out of
date? There is a new assertion that contiguous_pages matches the
state of the freelists at the end of FreePageManagerGet and
FreePageManagerPut, enabled if you defined FPM_EXTRA_ASSERTS, and this
passes my random allocation pattern testing.

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
dsa-v7.patch application/octet-stream 137.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2016-11-25 12:55:12 Re: Creating a DSA area to provide work space for parallel execution
Previous Message Tomas Vondra 2016-11-25 12:44:04 Re: confusing checkpoint_flush_after / bgwriter_flush_after