Shared mapping

riya khanna riyakhanna1983 at
Mon Jan 12 12:01:06 EST 2015

With shared memory mappings, once A and B both map the same memory
address/file they see the same contents
A [0xaaaaaaaa] - maps - to -> [0xAAAAAAAA]
B [0xbbbbbbbb] - maps - to -> [0xAAAAAAAA]

However, if A changes (update) the mappings to point to a different
memory area/file offset, B sees different contents
A [0xaaaaaaaa] - maps - to -> [0xBBBBBBBB]

Is there a way to force update the mappings of B, so that B too sees
contents at 0xBBBBBBBB?
Could this be done, by deleting the shmem backing and making the fault
handler update the mappings?

On Mon, Jan 12, 2015 at 10:50 AM,  <Valdis.Kletnieks at> wrote:
> On Mon, 12 Jan 2015 07:34:41 -0600, riya khanna said:
>> Suppose A and B have mapped the same physical memory or shmem file. I want
>> a way to make process A forcefuly revoke/remap the existing shared memory
>> mappings in process B, so that B sees whatever A does.
> Umm..B should be seeing what A does *already*.  That's the whole *point* of
> shared mmap spaces.
> And what problem are you trying to solve by doing this, anyhow?  There's
> probably a better approach (for starters, have A set up the mappings, then
> fork B which gets the mappings all set up from the start).

More information about the Kernelnewbies mailing list