pgsql: Remove redundant ftruncate() for POSIX DSM memory.

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove redundant ftruncate() for POSIX DSM memory.
Date: 2022-07-14 12:00:34
Message-ID: E1oBxWD-00086a-JQ@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2022-07-14 12:01:02 pgsql: Block signals while allocating DSM memory.
Previous Message Peter Eisentraut 2022-07-14 10:05:13 Re: pgsql: Avoid unsatisfied-external-reference errors in static inlines.