Re: Providing anonymous mmap as an option of sharing memory - Mailing list pgsql-hackers

From Kevin Brown
Subject Re: Providing anonymous mmap as an option of sharing memory
Date
Msg-id 20031127031751.GM6073@filer
Whole thread Raw
In response to Re: Providing anonymous mmap as an option of sharing memory  (Shridhar Daithankar <shridhar_daithankar@myrealbox.com>)
List pgsql-hackers
Shridhar Daithankar wrote:
> There seem to be two objections to mmap.
> 
> 1. If a backend from last crashed running postmaster exists then it might 
> have file etc. open and that is in general not such a good idea
> 
> 2. For replacing stdio for data and WAL files with mmap, mmap does not 
> guarantee order of IO which defeats WAL.

[...]

> Did I miss something?

Yes:  based on everything that I've read on the subject, you can't change
the size of a shared memory segment allocated by mmap().  It's unlikely
that mremap() will propgate changes to all other processes that share the
same area, since it can (if passed the proper flags) return a starting
address that differs from the current starting address.

And since propagation of the shared memory area is done via duplication
of the parent's page tables by the kernel at fork() time, new segments
would not be picked up by existing backends -- only new ones -- and then
only if the postmaster is the process that allocates them.


-- 
Kevin Brown                          kevin@sysexperts.com


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_restore and create FK without verification check
Next
From: Tom Lane
Date:
Subject: Re: pg_restore and create FK without verification check