diff --git a/src/backend/port/posix_sema.c b/src/backend/port/posix_sema.c
index 5719caf9b56838b5975dd35b71f9deb01766d8c3..445f34bb452c5ce6b1ac275bf56879958829fd76 100644
--- a/src/backend/port/posix_sema.c
+++ b/src/backend/port/posix_sema.c
@@ -41,13 +41,19 @@
 #error cannot use named POSIX semaphores with EXEC_BACKEND
 #endif
 
+typedef union SemTPadded
+{
+	sem_t		pgsem;
+	char		pad[PG_CACHE_LINE_SIZE];
+} SemTPadded;
+
 /* typedef PGSemaphore is equivalent to pointer to sem_t */
 typedef struct PGSemaphoreData
 {
-	sem_t		pgsem;
+	SemTPadded	sem_padded;
 } PGSemaphoreData;
 
-#define PG_SEM_REF(x)	(&(x)->pgsem)
+#define PG_SEM_REF(x)	(&(x)->sem_padded.pgsem)
 
 #define IPCProtection	(0600)	/* access/modify by user only */