Re: dynamic shared memory - Mailing list pgsql-hackers

From Robert Haas
Subject Re: dynamic shared memory
Date
Msg-id CA+TgmobdaUEkXWEvfE5VA_W7YL1sX03X92rOJrWmG0g_Z5PDXg@mail.gmail.com
Whole thread Raw
In response to Re: dynamic shared memory  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: dynamic shared memory
List pgsql-hackers
OK, here's v2 of this patch, by myself and Amit Kapila.  We made the
following changes:

- Added support for Windows.  This necessitated adding an impl_private
parameter to dsm_impl_op.
- Since we had impl_private anyway, I used it to implement shm
identifier caching for the System V implementation.  I like how that
turned out better than the previous version; YMMV.
- Fixed typo noted by Jim Nasby.
- Removed preferred_address parameter, per griping from Andres and Noah.
- Removed use of posix_fallocate, per recent commits.
- Added use of rename() so that we won't ever see a partially-written
state file, per griping by Jim Nasby.
- Added an overflow check so that if a user of a 32-bit system asks
for 4.1GB of dynamic shared memory, they get an error instead of
getting .1GB of memory.

Despite Andres's comments, I did not remove the mmap implementation or
the GUC that allows users to select which implementation they care to
use.  I still think those things are useful.  While I appreciate that
there's a marginal cost in complexity to each new GUC, I also don't
think it pays to get too cheap.  There's a difference between not
requiring users to configure things that they shouldn't have to
configure, and not letting them configure things they might want to
configure.  Besides, having a GUC also provides a way of turning the
feature completely off, which seems justified, at least for now, on
the basis of the (ahem) limited number of users of this facility.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Strange hanging bug in a simple milter
Next
From: Stephen Frost
Date:
Subject: Re: Strange hanging bug in a simple milter