On Wed, Jun 14, 2023 at 12:40 PM John Naylor <
john.naylor@enterprisedb.com> wrote:
>
> On Sat, Nov 5, 2022 at 3:27 PM Andres Freund <
andres@anarazel.de> wrote:
> > A real version would have to open /proc/self/maps and do this for at least
> > postgres' r-xp mapping. We could do it for libraries too, if they're suitably
> > aligned (both in memory and on-disk).
> For the postmaster, it should be simple to have a function that just takes the address of itself, then parses /proc/self/maps to find the boundaries within which it lies. I haven't thought about libraries much. Though with just the postmaster it seems that would give us the biggest bang for the buck?
Here's a start at that, trying with postmaster only. Unfortunately, I get "MADV_COLLAPSE failed: Invalid argument". I tried different addresses with no luck, and also got the same result with a small standalone program. I'm on ext4, so I gather I don't need "cp --reflink=never" but tried it anyway. Configuration looks normal by "grep HUGEPAGE /boot/config-$(uname -r)". Maybe there's something obvious I'm missing?
--
John Naylor
EDB:
http://www.enterprisedb.com