Re: [PATCH 1/1] Initial mach based shared memory support. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH 1/1] Initial mach based shared memory support.
Date
Msg-id 442009.1611016151@sss.pgh.pa.us
Whole thread Raw
In response to [PATCH 1/1] Initial mach based shared memory support.  (James Hilliard <james.hilliard1@gmail.com>)
Responses Re: [PATCH 1/1] Initial mach based shared memory support.  (James Hilliard <james.hilliard1@gmail.com>)
Re: [PATCH 1/1] Initial mach based shared memory support.  (James Hilliard <james.hilliard1@gmail.com>)
List pgsql-hackers
James Hilliard <james.hilliard1@gmail.com> writes:
> OSX implements sysv shmem support via a mach wrapper, however the mach
> sysv shmem wrapper has some severe restrictions that prevent us from
> allocating enough memory segments in some cases.
> ...
> In order to avoid hitting these limits we can bypass the wrapper layer
> and just use mach directly.

I wanted to review this, but it's impossible because the kernel calls
you're using have you've-got-to-be-kidding documentation like this:

https://developer.apple.com/documentation/kernel/1402504-mach_vm_page_info?language=objc

Google finds the source code too, but that's equally bereft of useful
documentation.  So I wonder where you obtained the information necessary
to write this patch.

I did notice however that mach_shmem.c seems to be 95% copy-and-paste from
sysv_shmem.c, including a lot of comments that don't feel particularly
true or relevant here.  I wonder whether we need a separate file as
opposed to a few #ifdef's around the kernel calls.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Mark G
Date:
Subject: Make gaps array static
Next
From: Tatsuro Yamada
Date:
Subject: Re: list of extended statistics on psql