Commit 181361a0 authored by Thomas Munro's avatar Thomas Munro

Reject huge_pages=on if shared_memory_type=sysv.

It doesn't work (it could, but hasn't been implemented).
Back-patch to 12, where shared_memory_type arrived.
Reported-by: default avatarAlexander Lakhin <exclusion@gmail.com>
Reviewed-by: default avatarAlexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/163271880203.22789.1125998876173795966@wrigleys.postgresql.org
parent a5b9a000
...@@ -1664,7 +1664,9 @@ include_dir 'conf.d' ...@@ -1664,7 +1664,9 @@ include_dir 'conf.d'
<para> <para>
At present, this setting is supported only on Linux and Windows. The At present, this setting is supported only on Linux and Windows. The
setting is ignored on other systems when set to setting is ignored on other systems when set to
<literal>try</literal>. <literal>try</literal>. On Linux, it is only supported when
<varname>shared_memory_type</varname> is set to <literal>mmap</literal>
(the default).
</para> </para>
<para> <para>
......
...@@ -686,6 +686,12 @@ PGSharedMemoryCreate(Size size, ...@@ -686,6 +686,12 @@ PGSharedMemoryCreate(Size size,
errmsg("huge pages not supported on this platform"))); errmsg("huge pages not supported on this platform")));
#endif #endif
/* For now, we don't support huge pages in SysV memory */
if (huge_pages == HUGE_PAGES_ON && shared_memory_type != SHMEM_TYPE_MMAP)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("huge pages not supported with the current shared_memory_type setting")));
/* Room for a header? */ /* Room for a header? */
Assert(size > MAXALIGN(sizeof(PGShmemHeader))); Assert(size > MAXALIGN(sizeof(PGShmemHeader)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment