/*
* Per-backend state when using io_method=io_uring
- *
- * Align the whole struct to a cacheline boundary, to prevent false sharing
- * between completion_lock and prior backend's io_uring_ring.
*/
-typedef struct pg_attribute_aligned (PG_CACHE_LINE_SIZE)
-PgAioUringContext
+typedef struct PgAioUringContext
{
+ /*
+ * Align the whole struct to a cacheline boundary, to prevent false
+ * sharing between completion_lock and prior backend's io_uring_ring.
+ */
+ alignas(PG_CACHE_LINE_SIZE)
+
/*
* Multiple backends can process completions for this backend's io_uring
* instance (e.g. when the backend issuing IO is busy doing something
*/
typedef struct PGPROC
{
+ /*
+ * Align the struct at cache line boundaries. This is just for
+ * performance, to avoid false sharing.
+ */
+ alignas(PG_CACHE_LINE_SIZE)
dlist_head *procgloballist; /* procglobal list that owns this PGPROC */
dlist_node freeProcsLink; /* link in procgloballist, when in recycled
* state */
uint32 wait_event_info; /* proc's wait information */
}
-
-/*
- * If compiler understands aligned pragma, use it to align the struct at cache
- * line boundaries. This is just for performance, to avoid false sharing.
- */
-#if defined(pg_attribute_aligned)
- pg_attribute_aligned(PG_CACHE_LINE_SIZE)
-#endif
PGPROC;
extern PGDLLIMPORT PGPROC *MyProc;