I am asking about Data structures used in the following:
I am wondering how linux tracks all the physical pages. I am not worried about how it keeps the vm_area_struct
. What is the data structure used to store all of them?
And how it looks up a particular physical page when it is given a virtual address?
Radix tree? red-black tree? hash table? what?
Thanks.
The kernel keeps an array of struct page
structures, one for each physical page.
A virtual address is looked up by walking the page table structure, which is a tree (defined by the hardware).