Re: Providing anonymous mmap as an option of sharing memory

From: Kevin Brown <kevin(at)sysexperts(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Providing anonymous mmap as an option of sharing memory
Date: 2003-11-27 03:17:51
Message-ID: 20031127031751.GM6073@filer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sysexperts(dot)com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-11-27 03:19:45 Re: pg_restore and create FK without verification check
Previous Message Tom Lane 2003-11-27 03:17:23 Re: pg_restore and create FK without verification check