Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7bae3bb

Browse files
committed
Create a distinct wait event for POSIX DSM allocation.
Previously we displayed "DSMFillZeroWrite" while in posix_fallocate(), because we shared the same wait event for "mmap" and "posix" DSM types. Let's introduce a new wait event "DSMAllocate", to be more accurate. Reported-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/20220711174518.yldckniicknsxgzl%40awork3.anarazel.de
1 parent 712704d commit 7bae3bb

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

doc/src/sgml/monitoring.sgml

+5
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,11 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
12961296
<entry><literal>CopyFileWrite</literal></entry>
12971297
<entry>Waiting for a write during a file copy operation.</entry>
12981298
</row>
1299+
<row>
1300+
<entry><literal>DSMAllocate</literal></entry>
1301+
<entry>Waiting for a dynamic shared memory segment to be
1302+
allocated.</entry>
1303+
</row>
12991304
<row>
13001305
<entry><literal>DSMFillZeroWrite</literal></entry>
13011306
<entry>Waiting to fill a dynamic shared memory backing file with

src/backend/storage/ipc/dsm_impl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ dsm_impl_posix_resize(int fd, off_t size)
364364
*/
365365
PG_SETMASK(&BlockSig);
366366

367-
pgstat_report_wait_start(WAIT_EVENT_DSM_FILL_ZERO_WRITE);
367+
pgstat_report_wait_start(WAIT_EVENT_DSM_ALLOCATE);
368368
#if defined(HAVE_POSIX_FALLOCATE) && defined(__linux__)
369369
/*
370370
* On Linux, a shm_open fd is backed by a tmpfs file. If we were to use

src/backend/utils/activity/wait_event.c

+3
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,9 @@ pgstat_get_wait_io(WaitEventIO w)
585585
case WAIT_EVENT_DATA_FILE_WRITE:
586586
event_name = "DataFileWrite";
587587
break;
588+
case WAIT_EVENT_DSM_ALLOCATE:
589+
event_name = "DSMAllocate";
590+
break;
588591
case WAIT_EVENT_DSM_FILL_ZERO_WRITE:
589592
event_name = "DSMFillZeroWrite";
590593
break;

src/include/utils/wait_event.h

+1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ typedef enum
178178
WAIT_EVENT_DATA_FILE_SYNC,
179179
WAIT_EVENT_DATA_FILE_TRUNCATE,
180180
WAIT_EVENT_DATA_FILE_WRITE,
181+
WAIT_EVENT_DSM_ALLOCATE,
181182
WAIT_EVENT_DSM_FILL_ZERO_WRITE,
182183
WAIT_EVENT_LOCK_FILE_ADDTODATADIR_READ,
183184
WAIT_EVENT_LOCK_FILE_ADDTODATADIR_SYNC,

0 commit comments

Comments
 (0)