pgsql: Remove redundant ftruncate() for POSIX DSM memory. - Mailing list pgsql-committers

From Thomas Munro
Subject pgsql: Remove redundant ftruncate() for POSIX DSM memory.
Date
Msg-id E1oBxWD-00086a-JQ@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pgsql: Avoid unsatisfied-external-reference errors in static inlines.
Next
From: Thomas Munro
Date:
Subject: pgsql: Block signals while allocating DSM memory.