postgresql/src/backend/port
Tom Lane cb775768e3 Try to find out the actual hugepage size when making a MAP_HUGETLB request.
Even if Linux's mmap() is okay with a partial-hugepage request, munmap()
is not, as reported by Chris Richards.  Therefore it behooves us to try
a bit harder to find out the actual hugepage size, instead of assuming
that we can skate by with a guess.

For the moment, just look into /proc/meminfo to find out the default
hugepage size, and use that.  Later, on kernels that support requests
for nondefault sizes, we might try to consider other alternatives.
But that smells more like a new feature than a bug fix, especially if
we want to provide any way for the DBA to control it, so leave it for
another day.

I set this up to allow easy addition of platform-specific code for
non-Linux platforms, if needed; but right now there are no reports
suggesting that we need to work harder on other platforms.

Back-patch to 9.4 where hugepage support was introduced.

Discussion: <31056.1476303954@sss.pgh.pa.us>
2016-10-13 15:06:46 -04:00
..
aix Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
dynloader Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
hpux Redefine Datum as uintptr_t, instead of unsigned long. 2009-12-31 19:41:37 +00:00
tas Update copyright for 2016 2016-01-02 13:33:40 -05:00
win32 Support building with Visual Studio 2015 2016-04-29 08:09:07 -04:00
.gitignore Combine win32 and unix latch implementations. 2016-03-21 11:03:26 +01:00
atomics.c Fix fallback implementation of pg_atomic_write_u32(). 2016-10-07 16:55:15 -07:00
Makefile Remove obsolete replacement system() on darwin 2016-08-18 12:00:00 -04:00
posix_sema.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
sysv_sema.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
sysv_shmem.c Try to find out the actual hugepage size when making a MAP_HUGETLB request. 2016-10-13 15:06:46 -04:00
win32_sema.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
win32_shmem.c Update copyright for 2016 2016-01-02 13:33:40 -05:00