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

From Shridhar Daithankar
Subject Re: Providing anonymous mmap as an option of sharing memory
Date
Msg-id 3FC4C58B.9070604@myrealbox.com
Whole thread Raw
In response to Re: Providing anonymous mmap as an option of sharing memory  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Providing anonymous mmap as an option of sharing memory  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Providing anonymous mmap as an option of sharing memory  (Kevin Brown <kevin@sysexperts.com>)
List pgsql-hackers
Tom Lane wrote:
> Shridhar Daithankar <shridhar_daithankar@myrealbox.com> writes:
> 
>>I was looking thr. the source and thought it would be worth to seek
>>opinion on this proposal.
> This has been discussed and rejected before.  See the archives.

I went thr. this for details.

http://developer.postgresql.org/cvsweb.cgi/pgsql-server/doc/TODO.detail/mmap

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.

I covered only first point in my post. IMO it is not such a unsolvable problem. 
If a postmaster crashes hard but leaves a backend running, would it clean pid 
file etc? I don't think so. So if a postmaster can start on a 'pid-clean' state, 
then it is guaranteed to be no childs left around.

There were issues where linux not supporting MAP_SHARE and MAP_ANONYMOUS 
simaltenously but they are quite old messages, from 1998, talking of linux 
2.0.x. I don't think it is still true anymore but need to check.

Too bad, freeBSD M_NOSYNC is not a standard otherwise even for point 2, it could 
have been considered.

Did I miss something?
 Shridhar



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: statistics about tamp tables ...