Keeping track of pages


Many, in fact, most, of the physical pages on the machine will be usable for many purposes. The kernel needs to keep track of these pages and identify who owns them or what data they contain. Every page not dedicated to the kernel's use must have a data structure describing that page ”strangely enough, called a page structure. There is one for every page on the machine (except for the kernel pages locked down at boot time). Thus, if you add memory to your system, you will be increasing the kernel data space requirements (although not by much) to keep track of it.

The page structure has some interesting information in it. There is a pointer to a vnode, which indicates what file the data in this page comes from. There is a flag that notes that the page is "dirty" ” which just means that it has been modified and these changes need to be saved on disk someplace. Another flag indicates that the page is not currently associated with a process but is on the free list. Pointers keep all the pages on the free list linked together. More pointers link the pages with data into a list organized by vnode so the kernel can find them.

The page structures are allocated in kernel memory fairly soon in the boot process. They are created as a single array, sized according to the amount of physical memory available on the system. The address of the start of the array is kept in the kernel variable, pages, and the end of the list is pointed to by epages .

Page structures are defined in the /usr/include/vm/page.h header file.



PANIC. UNIX System Crash Dump Analysis Handbook
PANIC! UNIX System Crash Dump Analysis Handbook (Bk/CD-ROM)
ISBN: 0131493868
EAN: 2147483647
Year: 1994
Pages: 289
Authors: Chris Drake

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net