--- a/src/backend/storage/ipc/shmem.c
+++ b/src/backend/storage/ipc/shmem.c
@@ -173,7 +173,7 @@ ShmemAlloc(Size size)
        /*
         * ensure all space is adequately aligned.
         */
-       size = MAXALIGN(size);
+       size = CACHELINEALIGN(size);

        Assert(ShmemSegHdr != NULL);

