memory management basic theory
I am trying to understand basic kernel memory management from this page: www tldp.org/LDP/tlk/mm/memory.html. It says:
I don't understand why does Linux need to find the vm_area_struct that represents the area of memory that the page fault occured in. Linux is supposed to know already where is vm_area_struct which is trying to access in the first place, before the page fault occured.
Once an executable image has been memory mapped into a processes virtual memory it can start to execute. As only the very start of the image is physically pulled into memory it will soon access an area of virtual memory that is not yet in physical memory. When a process accesses a virtual address that does not have a valid page table entry, the processor will report a page fault to Linux.
The page fault describes the virtual address where the page fault occurred and the type of memory access that caused.
Linux must find the vm_area_struct that represents the area of memory that the page fault occurred in.
Thank you for suggestions.