Shared mapping
From: riya khanna <hidden>
Date: 2015-01-12 13:34:41
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. On Monday, January 12, 2015, Pranay Srivastava [off-list ref] wrote:
Hi Riya, On Mon, Jan 12, 2015 at 2:08 AM, riya khanna <riyakhanna1983@gmail.com <javascript:;>> wrote:quoted
Hi, Is there a way, w.r.t memory contents, to make a process B see what process A sees through shared memory mappings? Suppose Process A has mapped a device file (say F) at address 0xaaaaaaaa in its address space. Is it possible for process B to see the same device file F contents as process A via shared memory mappings? If mapped in process B's address space, would process B continue to to see the old contents if process A were to map a new device file (say N) at the same address 0xaaaaaaaa in its address space or do they have independent mappings?It depends on the driver mapping that specific memory address. If it so chooses that every process trying to map that address needs to have an independent page then it'll do that. But normally if the driver allows mmapping device then it'll be a separate copy.quoted
So basically I'm trying to understand if there could be virtual to virtual mappings (e.g. process B mapping process A's memory, so that B sees whatever A sees)?This means you are getting two separate pages when you mmap the device? Normally your driver won't give you same page since once a page is mapped simple writes(like assignments etc) won't trigger any fault which might give the driver a chance to do proper locking semantics when both processes are writing at same time using just an assignment. What you can do is create a shared mapping between the two processes A and B then fill that mapping from whoever wins the race to update this shared mapping between them. You can add some information if the information needs to be updated again in this shared region between A and B. Can you tell more about your problem?quoted
Thanks for your help! -Riya _______________________________________________ Kernelnewbies mailing list Kernelnewbies at kernelnewbies.org <javascript:;> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies-- ---P.K.S
-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150112/daf717de/attachment-0001.html