Memory Management


Managing memory has several levels of software as well. High-level functions keep track of memory associated with each process, but low-level hardware specific code must handle the mechanics of dealing with the memory management unit (MMU) and setting up the virtual addressing. These lower-level functions are known as the hat (Hardware Address Translation) layer.

Higher-level, more generic functions keep track of the ranges of memory addresses that are valid for a particular process address space and identify pages that are in use.

Each process has an address space ( as ) structure associated with it, defining the valid segments of the address space and what their attributes are. For user programs, each individual segment will eventually point to a vnode. This vnode is used to identify the file you will need to fetch data from when it can't be found in memory or to store pages in when they have to be removed (paged out). The as structures also allow the system to identify a segmentation violation; a page fault results in a search down the list of valid segments to find the appropriate address range. If the address isn't found, it's a segmentation violation and a SEGV signal is sent to the process.

In addition, each page of physical memory that is not initially grabbed by the kernel at boot has a page structure associated with it, indicating how that page is being used. (Locked-down kernel pages will not have such a structure because they are dedicated to the kernel, and cannot be used for any other purpose). It's not always possible to get from a page structure back to "who's using it," but sometimes you can get general information on the page state ("on the free list" versus "locked down" or in use). Each page structure does contain information about what file it belongs to and which page within that file the data came from.

These are some of the more commonly examined areas of the kernel. This is not because most errors occur here, but because these are often the starting points when looking for information on the state of the system and the processes (or threads) running on it.



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