Home > Store > Operating Systems, Server

larger cover

Add To My Wish List

Understanding the Linux Virtual Memory Manager

Register your product to gain access to bonus material or receive a coupon.

  • Description
  • Downloads
  • Reviews
  • Sample Content

Product Author Bios

MEL GORMAN specializes in documenting open source software. He holds a MSc in Computer Science from the University of Limerick, Ireland, and has served as an instructor there. He has worked as a system administrator, applications developer, and consultant, and has been researching Linux memory management for more than two years. Currently he is an applications developer with J2EE technologies at IBM, Dublin.

Finally, a comprehensive guide to the Linux VM!

VM's behavior affects every Linux kernel subsystem and dramatically impacts overall performance. But until now, there was only one way to understand VM: study the poorly documented source one line at a time. Now there's an easier, faster alternative. This book describes VM in unprecedented detail, presenting both theoretical foundations and a line-by-line source code commentary. It systematically covers everything from physical memory description to out-of-memory management. Coverage includes:

  • Linux VM 2.4 architecture in depth-with diagrams and call graphs
  • Physical memory description, page tables, address spaces, and memory allocation
  • High memory, swapping, shared memory, and much more
  • Expert guidance for analyzing the code of any open source project
  • New Linux 2.6 kernel features in every chapter

Well organized and superbly written, Understanding the Linux Virtual Memory Manager will be indispensable to every kernel programmer and researcher.

CD-ROM INCLUDED

Complete VM Learning Lab! Contains the author's new toolkit for exploring VM, including a browsable version of kernel source, CodeViz call graph generator; and VMRegress for analyzing and benchmarking VM. Also includes all code commentary in HTML, PDF, and plain text formats.

Customer Reviews

33 of 36 people found the following review helpful
4.0 out of 5 stars Non-trivial subject, May 8, 2004
By 
W Boudville (Terra, Sol 3) - See all my reviews
(VINE VOICE)    (TOP 500 REVIEWER)    (HALL OF FAME REVIEWER)    (REAL NAME)   
This review is from: Understanding the Linux Virtual Memory Manager (Paperback)
A slightly unusual book from Prentice-Hall. If you peruse a list of their recent offerings, this book stands out as rather more specialised. Certainly, in general there is no shortage of linux books, from a variety of publishers. But typically such books are aimed at using linux or they describe applications built atop it. Whereas the technical ability and interest in actually understanding and changing any operating system (not just linux) acts as a tremendous barrier. Hence, the potential audience for Gorman's book is quite exclusive. An upside is that it reduces the potential competition from other authors and publishers.

Gorman is attempting an outreach to potential linux developers. The book has two parts. The first explains key concepts for the VMM. He quickly gets into the issues, with little preamble. In other words, you need at a minimum to be fluent in C, and have some acquaintance with the ideas of memory management, though not necessarily with linux.

Each algorithm in... Read more

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


7 of 7 people found the following review helpful
4.0 out of 5 stars Nuts and bolts of Linux VM, not for beginners, April 30, 2006
By 
G. Tamindijza (Chicago, IL, USA) - See all my reviews
(REAL NAME)   
This review is from: Understanding the Linux Virtual Memory Manager (Paperback)
If the title of the book is a hint that it is not for the masses, then the additional information one is presented with is a definite confirmation of this fact.

The book is an in depth look into intricate workings of one of the most complicated and sophisticated parts of any OS that supports virtual memory concepts. As such, it is not an easy read for people who are not familiar with programming and general OS concepts, and since, to be honest, most people today do not fall into this category, this book has a very specific audience. In short, if you do not already know how TLB operates, do not even look at it.

The text itself is nicely organized, hierarchy is well defined, concepts explained. Detailed description of logic is supported by the code examples that are dissected in detail, and in my mind provide an excellent learning resource.

One drawback that caused 4 stars, instead of 5, is the lack of common terminology; rather, author explains in his... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


3 of 3 people found the following review helpful
5.0 out of 5 stars Meets its goal, July 18, 2006
By 
rdf "rdf_acm" (Cambridge, Ma. USA) - See all my reviews
Amazon Verified Purchase(What's this?)
This review is from: Understanding the Linux Virtual Memory Manager (Paperback)
The book's goal "a detailed view of the Linux VM as implemented in 2.4.22" -- as I think the specification of the version to that level of detail indicates, it is not a theoretical exercise.

Given that goal the book is well structured, building up from from basic functionality and giving references to both theory and measurement as appropriate

There's ~500 pages of annotated source that's preceded by a clear ~200 page discussion of its functionality and behavior
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


Share your thoughts with other customers:
 See all 4 customer reviews...

Praise For Understanding the Linux Virtual Memory Manager

Untitled Document "I'd recommend this book to anyone who has an interest in doing development on the Virtual Memory Manager -- in fact I would venture to say it should be "required reading" if that is your intent -- or anyone who wants a REALLY deep understanding of the Virtual Memory Manager." -- Stuart W. Finlayson, the South Jersey Linux User's Group, http://www.sjlinux.org/lug/

Online Sample Chapter

Page Table Management

Table of Contents



Preface.


1. INTRODUCTION.

Getting Started. Managing the Source. Browsing the Code. Reading the Code. Submitting Patches.



2. Describing Physical Memory.

Nodes. Zones. Zone Initialization. Initializing mem map. Pages. Mapping Pages to Zones. High Memory. Whats New in 2.6.



3. Page Table Management.

Describing the Page Directory. Describing a Page Table Entry. Using Page Table Entries. Translating and Setting Page Table Entries. Allocating and Freeing Page Tables. Kernel Page Tables. Mapping Addresses to a struct page. Translation Lookaside Bu.er (TLB). Level 1 CPU Cache Management. Whats New in 2.6.



4. Process Address Space.

Linear Address Space. Managing the Address Space. Process Address Space Descriptor. Memory Regions. Exception Handling. Page Faulting. Copying to/from Userspace. Whats New in 2.6.



5. Boot Memory Allocator.

Representing the Boot Map. Initializing the Boot Memory Allocator. Initializing bootmem data. Allocating Memory. Freeing Memory. Retiring the Boot Memory Allocator. Whats New in 2.6.



6. Physical Page Allocation.

Managing Free Blocks. Allocating Pages. Free Pages. Get Free Page (GFP) Flags. Process Flags. Avoiding Fragmentation. Whats New in 2.6.



7. Noncontiguous Memory Allocation.

Describing Virtual Memory Areas. Allocating a Noncontiguous Area. Freeing a Noncontiguous Area. Whats New in 2.6.



8. Slab Allocator.

Caches. Slabs. Objects. Sizes Cache. Per-CPU Object Cache. Slab Allocator Initialization. Interfacing With the Buddy Allocator. Whats New in 2.6.



9. High Memory Management.

Managing the PKMap Address Space. Mapping High Memory Pages. Unmapping Pages. Mapping High Memory Pages Atomically. Bounce Bu.ers. Emergency Pools. Whats New in 2.6.



10. Page Frame Reclamation.

Page Replacement Policy. Page Cache. LRU Lists. Shrinking All Caches. Swapping Out Process Pages. Pageout Daemon (kswapd). Whats New in 2.6.



11. Swap Management.

Describing the Swap Area. Mapping Page Table Entries to Swap Entries. Allocating a Swap Slot. Swap Cache. Reading Pages From Backing Storage. Writing Pages to Backing Storage. Reading/Writing Swap Area Blocks. Activating a Swap Area. Deactivating a Swap Area. Whats New in 2.6.



12. Shared Memory Virtual Filesystem.

Initializing the Virtual Filesystem. Using shmem Functions. Creating Files in tmpfs. Page Faulting Within a Virtual File. File Operations in tmpfs. Inode Operations in tmpfs. Setting Up Shared Regions. System V IPC. Whats New in 2.6.



13. Out Of Memory Management.

Checking Available Memory. Determining OOM Status. Selecting a Process. Killing the Selected Process. Is That It? Whats New in 2.6.



14. The Final Word.


A. Introduction.


B. Describing Physical Memory.

Initializing Zones. Page Operations.



C. Page Table Management.

Page Table Initialization. Page Table Walking.



D. Process Address Space.

Process Memory Descriptors. Creating Memory Regions. Searching Memory Regions. Locking and Unlocking Memory Regions. Page Faulting. Page-Related Disk I/O.



E. Boot Memory Allocator.

Initializing the Boot Memory Allocator. Allocating Memory. Freeing Memory. Retiring the Boot Memory Allocator.



F. Physical Page Allocation.

Allocating Pages. Allocation Helper Functions. Free Pages. Free Helper Functions.



G. Noncontiguous Memory Allocation.

Allocating a Noncontiguous Area. Freeing a Noncontiguous Area.



H. Slab Allocator.

Cache Manipulation. Slabs. Objects. Sizes Cache. Per-CPU Object Cache. Slab Allocator Initialization. Interfacing with the Buddy Allocator.



I. High Memory Mangement.

Mapping High Memory Pages. Mapping High Memory Pages Atomically. Unmapping Pages. Unmapping High Memory Pages Atomically. Bounce Bu.ers. Emergency Pools.



J. Page Frame Reclamation.

Page Cache Operations. LRU List Operations. Re.lling inactive list. Reclaiming Pages From the LRU Lists. Shrinking All Caches. Swapping Out Process Pages. Page Swap Daemon.



K. Swap Management.

Scanning for Free Entries. Swap Cache. Swap Area I/O. Activating a Swap Area. Deactivating a Swap Area.



L. Shared Memory Virtual Filesystem.

Initializing shmfs. Creating Files in tmpfs. File Operations in tmpfs. Inode Operations in tmpfs. Page Faulting Within a Virtual File. Swap Space Interaction. Setting Up Shared Regions. System V IPC.



M. Out of Memory Management.

Determining Available Memory. Detecting and Recovering From OOM.



References.


Code Commentary Index.


Index.


About the Author.

Downloadable Sample Chapter

Download the Sample Chapter related to this title.

 
Buy

Book  $64.99  $51.99

Usually ships in 24 hours.

This book includes free shipping!

Purchase Reward: One Month Free Subscription
By completing any purchase on InformIT, you become eligible for an unlimited access one-month subscription to Safari Books Online.

Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.