postgresql/src/include
Michael Paquier 43c1c4f65e Introduce GUC shared_memory_size_in_huge_pages
This runtime-computed GUC shows the number of huge pages required
for the server's main shared memory area, taking advantage of the
work done in 0c39c29 and 0bd305e.  This is useful for users to estimate
the amount of huge pages required for a server as it becomes possible to
do an estimation without having to start the server and potentially
allocate a large chunk of shared memory.

The number of huge pages is calculated based on the existing GUC
huge_page_size if set, or by using the system's default by looking at
/proc/meminfo on Linux.  There is nothing new here as this commit reuses
the existing calculation methods, and just exposes this information
directly to the user.  The routine calculating the huge page size is
refactored to limit the number of files with platform-specific flags.

This new GUC's name was the most popular choice based on the discussion
done.  This is only supported on Linux.

I have taken the time to test the change on Linux, Windows and MacOS,
though for the last two ones large pages are not supported.  The first
one calculates correctly the number of pages depending on the existing
GUC huge_page_size or the system's default.

Thanks to Andres Freund, Robert Haas, Kyotaro Horiguchi, Tom Lane,
Justin Pryzby (and anybody forgotten here) for the discussion.

Author: Nathan Bossart
Discussion: https://postgr.es/m/F2772387-CE0F-46BF-B5F1-CC55516EB885@amazon.com
2021-09-21 10:31:58 +09:00
..
access Revert "Avoid creating archive status ".ready" files too early" 2021-09-04 12:14:30 -04:00
bootstrap process startup: Remove bootstrap / checker modes from AuxProcType. 2021-08-05 12:18:15 -07:00
catalog Revoke PUBLIC CREATE from public schema, now owned by pg_database_owner. 2021-09-09 23:38:09 -07:00
commands Send NOTIFY signals during CommitTransaction. 2021-09-14 17:18:25 -04:00
common Update Unicode data to Unicode 14.0.0 2021-09-15 08:16:44 +02:00
datatype
executor Remove arbitrary 64K-or-so limit on rangetable size. 2021-09-15 14:11:21 -04:00
fe_utils Unify parsing logic for command-line integer options 2021-07-24 18:35:03 +09:00
foreign
jit jit: Do not try to shut down LLVM state in case of LLVM triggered errors. 2021-09-13 18:26:15 -07:00
lib Fix incorrect hash table resizing code in simplehash.h 2021-08-13 16:41:26 +12:00
libpq Refactor SASL code with a generic interface for its mechanisms 2021-07-07 10:55:15 +09:00
mb Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00
nodes Remove arbitrary 64K-or-so limit on rangetable size. 2021-09-15 14:11:21 -04:00
optimizer Change the name of the Result Cache node to Memoize 2021-07-14 12:43:58 +12:00
parser Remove Value node struct 2021-09-09 08:36:53 +02:00
partitioning Allow ordered partition scans in more cases 2021-08-03 12:25:52 +12:00
port Use direct function calls for pg_popcount{32,64} on non-x86 platforms 2021-08-16 11:51:15 -04:00
portability
postmaster Refactor the syslogger pipe protocol to use a bitmask for its options 2021-09-13 09:03:45 +09:00
regex Avoid determining regexp subexpression matches, when possible. 2021-08-09 11:26:34 -04:00
replication Remove code duplication for permission checks with replication slots 2021-09-14 10:15:49 +09:00
rewrite Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
snowball
statistics
storage Introduce GUC shared_memory_size_in_huge_pages 2021-09-21 10:31:58 +09:00
tcop process startup: Split single user code out of PostgresMain(). 2021-09-17 19:56:47 -07:00
tsearch
utils Support "postgres -C" with runtime-computed GUCs 2021-09-16 10:59:26 +09:00
.gitignore
c.h
fmgr.h
funcapi.h Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
getaddrinfo.h
getopt_long.h
Makefile
miscadmin.h Doc: add glossary term for "auxiliary process" 2021-09-20 12:22:02 -03:00
pg_config_ext.h.in
pg_config_manual.h Rename debug_invalidate_system_caches_always to debug_discard_caches. 2021-07-13 15:01:01 -04:00
pg_config.h.in Portability fixes for sigwait. 2021-07-15 12:34:31 +12:00
pg_getopt.h
pg_trace.h
pgstat.h pgstat: Prepare to use mechanism for truncated rels also for droppped rels. 2021-09-20 14:02:48 -07:00
pgtar.h
pgtime.h Fix actively-misleading comments about the contents of struct pg_tm. 2021-09-06 11:43:44 -04:00
port.h
postgres_ext.h
postgres_fe.h
postgres.h Fix misleading comments about TOAST access macros. 2021-09-08 14:11:35 -04:00
rusagestub.h
windowapi.h