 <p><strong>shmat()</strong> is a typical example of same physical address being mapped as two different virtual address in two different processes. If you do pmap -x pid_A . you will you see the virtual mem map for process A similarly for Process B. Actual Phy mem is not exposed to the user-space program.</p> <p>Now SayProcess A and B share a shared memory segment and shared memory pointer be sh_mem_ptr_A and Sh_mem_ptr_B. If you print these pointers their address(virtual) will be different. Because Sh_mem_ptr_A is a part of memory map of Process A, Similarly sh_mem_ptr_B for Process B.</p> <p>Kernel maintains the maaping of Virtual-to- phy addr. By page table and offset. Higher bits map to the page table and offset maps to offset in the page table. So If you notice the Lower order bits of sh_mem_ptr_A and sh_mem_ptr_B they will be same(but may not be true always).</p>