Pages


Individual pages on the machine that are not permanently dedicated to the kernel are tracked by a page structure. This structure keeps some state information about a page and a pointer to the vnode to which the data in this page belongs. A list of pages organized by vnode and offset (how far into the "file" this page belongs) keeps track of pages containing data for specific vnodes. If a user wants a certain piece of data from some file, the kernel can rapidly find out if that data is already resident in memory.

There are many functions that deal with pages: finding them, freeing them, hashing them, locking them. These all deal with pages above a hardware level and are generally similar across versions of the OS. Some that you may see are:

  • page_lookup() ” Find a page. Given a vnode and an offset, look through the pages in memory to see if it is there. If it is but it's "in transit" (i.e., being loaded up), the caller will sleep and wait for the I/O to finish.

  • page_hashout() ” Remove a page from the list of pages, based on the vnode/offset data pair.

  • page_reclaim() ” Grab the page from the free list and attach it to the list of pages associated with a vnode. This implements a "soft page fault" where the data is still in memory although not directly entered in a process's address space.

There are a lot more page functions. The page structure and the list of page related functions are defined in /usr/include/vm/page.h .



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