The object-based reverse-mapping VM
Posted Feb 28, 2003 9:09 UTC (Fri) by
IkeTo (subscriber, #2122)
In reply to:
The object-based reverse-mapping VM by giraffedata
Parent article:
The object-based reverse-mapping VM
>A Linux 'struct page' describes a page frame, not a page. A page table entry,
>among other things, describes a page.
I teach operating systems as well, and so I'm the kind of people who insists that people should use the right terminology. ;p
A page table entry describes *both* a page and a frame, so the above statement is quite misleading. In particular, a page table is a mapping from pages to frames in case the frame is really in physical memory. For those pages that are not yet created in physical memory, a page table says nearly nothing about it. So it is more a frame thing than a page thing.
In Linux, memory of the system is described by a "mm_struct" memory descriptor. The descriptor has two important part: the physical part, which includes the page table described above (about the frames), and the logical part, which includes something called a "VM area struct". Such a vm_area_struct is the thing that really know what to do when a page that has no frame is accessed. In particular, it knows whether that the page is mapped to some disk file, so that whenever read the disk should be loaded; or that the page is mapped to some device, so the device driver should be called to generate the page content; or that the page is on copy-on-write, which means that the kernel must make a copy to the read-only frame that is written into; etc.
Of course there is the second half of the story, which is about the swap. This time the page table really have the information about it. In particular, the "swapped-out page identifier". It is used to hold information about "where is the page stored in the swap?". If you treat swap as extension to the physical frames, it is natural that it is store in the page table: because it is something about the physical frames (indeed its extension), not about the logical page.
(
Log in to post comments)