Re: Large pages

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Wed, 14 Nov 2012 09:14:55 -0000
Message-ID: <KuednbvKLJGS_D7NnZ2dnUVZ8kWdnZ2d_at_bt.com>



"Mladen Gogala" <gogala.mladen_at_gmail.com> wrote in message news:pan.2012.11.14.04.19.39_at_gmail.com...
| On Tue, 13 Nov 2012 17:24:32 +0000, Jonathan Lewis wrote:
|
|
| > However,
| > a) he does mention Solaris and intimate shared memory - and explains
| that
| > shared page tables are possible
| > b) the article is dated Dec 2007 - so things may have changed
| >
| > Do you have any specific versions of Unix in mind when you state that
| the
| > page table for a shared memory segment is automatically shared ? Is
| this,
| > perhaps a specific default for OEL.
|
|
| Jonathan, I don't see any results and the articles about Linux page
| tables are surprisingly hard to find. I was unable to find the conclusive
| proof. The best I was able to find are the following articles:
|
| http://appcrawler.com/wordpress/2010/05/11/686/
| http://lwn.net/Articles/149888/
| http://lwn.net/Articles/149804/
|
|
| However, logic tells me that it is not possible for every process to have
| its own, independently maintained page table because there would be no
way
| to ensure coherence. If process A experiences a page fault and gets frame
| 1234 into its page table, it wouldn't be possible for the process B to
| see that event without sharing page tables. And shared memory means not
| only the same content but also the same addresses and sequence number.
| There would be no way to ensure that without sharing page tables. The
| proof can be seen from the fact that shared memory is only counted once
| when you are doing sum of memory consumption per process.
| It would be absolutely impossible to coordinate access if each process
| was operating its own map of the shared memory.
| That is why shared memory is a separate part of kernel, very expensive to
| implement. One needs exceedingly complex, segment based memory
management.
| --
| Mladen Gogala
| The Oracle Whisperer
| http://mgogala.byethost5.com

Mladen,

Thanks for the comments and links. I'll be following this stuff up to see where I went wrong.

In passing - logic also dictates that I ask the question:

    What happens if I attached to a shared memory segment AFTER I've allocated a load of private memory and the (logical) addresses in the page table for the private memory overlap the logical addresses in the page table for the shared memory segment ? Clearly one can bypass the issue with a little thought - e.g. by allocating from high logical addresses downwards for shared and low upwards for private - but I hadn't previously thought that point through.)

Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com/all-postings

Author: Oracle Core (Apress 2011)
http://www.apress.com/9781430239543 Received on Wed Nov 14 2012 - 10:14:55 CET

Original text of this message