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
<entry><literal>CopyFileWrite</literal></entry>
<entry>Waiting for a write during a file copy operation.</entry>
</row>
+ <row>
+ <entry><literal>DSMAllocate</literal></entry>
+ <entry>Waiting for a dynamic shared memory segment to be
+ allocated.</entry>
+ </row>
<row>
<entry><literal>DSMFillZeroWrite</literal></entry>
<entry>Waiting to fill a dynamic shared memory backing file with
*/
PG_SETMASK(&BlockSig);
- pgstat_report_wait_start(WAIT_EVENT_DSM_FILL_ZERO_WRITE);
+ pgstat_report_wait_start(WAIT_EVENT_DSM_ALLOCATE);
#if defined(HAVE_POSIX_FALLOCATE) && defined(__linux__)
/*
* On Linux, a shm_open fd is backed by a tmpfs file. If we were to use
case WAIT_EVENT_DATA_FILE_WRITE:
event_name = "DataFileWrite";
break;
+ case WAIT_EVENT_DSM_ALLOCATE:
+ event_name = "DSMAllocate";
+ break;
case WAIT_EVENT_DSM_FILL_ZERO_WRITE:
event_name = "DSMFillZeroWrite";
break;
WAIT_EVENT_DATA_FILE_SYNC,
WAIT_EVENT_DATA_FILE_TRUNCATE,
WAIT_EVENT_DATA_FILE_WRITE,
+ WAIT_EVENT_DSM_ALLOCATE,
WAIT_EVENT_DSM_FILL_ZERO_WRITE,
WAIT_EVENT_LOCK_FILE_ADDTODATADIR_READ,
WAIT_EVENT_LOCK_FILE_ADDTODATADIR_SYNC,