PostgresSQL vs super pages

Thomas Munro munro at ip9.org
Thu Oct 11 01:01:34 UTC 2018


On Thu, 11 Oct 2018 at 13:20, Konstantin Belousov <kostikbel at gmail.com> wrote:
> On Thu, Oct 11, 2018 at 12:59:41PM +1300, Thomas Munro wrote:
> > shm_open("/PostgreSQL.1721888107",O_RDWR|O_CREAT|O_EXCL,0600) = 46 (0x2e)
> > ftruncate(46,0x400000)                           = 0 (0x0)
> Try to write zeroes instead of truncating.
> This should activate the fast path in the fault handler, and if the
> pages allocated for backing store of the shm object were from reservation,
> you should get superpage mapping on the first fault without promotion.

If you just write() to a newly shm_open()'d fd you get a return code
of 0 so I assume that doesn't work.  If you ftruncate() to the desired
size first, then loop writing 8192 bytes of zeroes at a time, it
works.  But still no super pages.  I tried also with a write buffer of
2MB of zeroes, but still no super pages.  I tried abandoning
shm_open() and instead using a mapped file, and still no super pages.


More information about the freebsd-hackers mailing list