pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove redundant ftruncate() for POSIX DSM memory.
Date: Thu, 14 Jul 2022 12:00:34 +0000
Message-ID: <E1oBxWD-00086a-JQ@gemulon.postgresql.org> (raw)

Remove redundant ftruncate() for POSIX DSM memory.

In early releases of the DSM infrastructure, it was possible to resize
segments.  That was removed in release 12 by commit 3c60d0fa.  Now the
ftruncate() + posix_fallocate() sequence during DSM segment creation has
a redundant step: we're always extending from zero to the desired size,
so we might as well just call posix_fallocate().

Let's also include the remaining ftruncate() call (non-Linux POSIX
systems) in the wait event reporting, for good measure.

Discussion: https://postgr.es/m/CA%2BhUKGJSm-nq8s%2B_59zb7NbFQF-OS%3DxTnTAiGLrQpuSmU2y_1A%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/712704d3539e5ed6807e0b46fddaaf8ed47c2403

Modified Files
--------------
src/backend/storage/ipc/dsm_impl.c | 54 ++++++++++++++++++--------------------
1 file changed, 25 insertions(+), 29 deletions(-)



Message-ID: <E1oBxWD-00086a-JQ@gemulon.postgresql.org>
Permalink:  ../E1oBxWD-00086a-JQ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oBxWD-00086a-JQ@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tmunro@postgresql.org
  Subject: Re: pgsql: Remove redundant ftruncate() for POSIX DSM memory.
  In-Reply-To: <E1oBxWD-00086a-JQ@gemulon.postgresql.org>
  References: <E1oBxWD-00086a-JQ@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox