Question about object-based reverse mapping

Hao Lee haolee.swjtu at gmail.com
Sun Jan 1 07:01:25 EST 2017


Hi, all

I'm currently reading "Understanding the Linux Kernel (3rd)" and I
have a question about "object-based reverse mapping".

This is the Figure 17-1 on page 683 : http://imgur.com/R0OtIJh

As this figure shows, many vm_area_struct are in the anon_vma’s list
and they share some page frames.

The index field in page struct represents the offset of virtual
address within the virtual memory area. What I want to know is what
would happen when a page frame is shared by several vm_area_struct.

If two virtual memory areas share the same page frame, it seems that
page->index would be overridden because there are two vma and the
variable index would be assigned two times. How the linux kernel
prevent it happening.

Thanks.
Hao Lee



More information about the Kernelnewbies mailing list