aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc/dsm_impl.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2020-01-31 17:21:47 +1300
committerThomas Munro <tmunro@postgresql.org>2020-01-31 17:29:41 +1300
commitef02fb15a35ab7bd74a79afebf35572ed82b5e9f (patch)
tree83a6c8db87805bbb7e4d8fea7f865f448c3dcd14 /src/backend/storage/ipc/dsm_impl.c
parentd061ea21fc1cc1c657bb5c742f5c4a1564e82ee2 (diff)
downloadpostgresql-ef02fb15a35ab7bd74a79afebf35572ed82b5e9f.tar.gz
postgresql-ef02fb15a35ab7bd74a79afebf35572ed82b5e9f.zip
Report time spent in posix_fallocate() as a wait event.
When allocating DSM segments with posix_fallocate() on Linux (see commit 899bd785), report this activity as a wait event exactly as we would if we were using file-backed DSM rather than shm_open()-backed DSM. Author: Thomas Munro Discussion: https://postgr.es/m/CA%2BhUKGKCSh4GARZrJrQZwqs5SYp0xDMRr9Bvb%2BHQzJKvRgL6ZA%40mail.gmail.com
Diffstat (limited to 'src/backend/storage/ipc/dsm_impl.c')
-rw-r--r--src/backend/storage/ipc/dsm_impl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c
index 3f7a8a4fa08..138bdec47e9 100644
--- a/src/backend/storage/ipc/dsm_impl.c
+++ b/src/backend/storage/ipc/dsm_impl.c
@@ -371,10 +371,12 @@ dsm_impl_posix_resize(int fd, off_t size)
* interrupt pending. This avoids the possibility of looping forever
* if another backend is repeatedly trying to interrupt us.
*/
+ pgstat_report_wait_start(WAIT_EVENT_DSM_FILL_ZERO_WRITE);
do
{
rc = posix_fallocate(fd, 0, size);
} while (rc == EINTR && !(ProcDiePending || QueryCancelPending));
+ pgstat_report_wait_end();
/*
* The caller expects errno to be set, but posix_fallocate() doesn't