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

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

From
Thomas Munro
Date:
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(-)