After this documentation was released in July 2003, I was approached
by Prentice Hall and asked to write a book on the Linux VM under the Bruce Peren's Open Book Series.
The book is available and called simply "Understanding The Linux Virtual
Memory Manager". There is a lot of additional material in the book that is
not available here, including details on later 2.4 kernels, introductions
to 2.6, a whole new chapter on the shared memory filesystem, coverage of TLB
management, a lot more code commentary, countless other additions and
clarifications and a CD with lots of cool stuff on it. This material (although
now dated and lacking in comparison to the book) will remain available
although I obviously encourge you to buy the book from your favourite book
store :-) . As the book is under the Bruce Perens Open Book Series, it will
be available 90 days after appearing on the book shelves which means it
is not available right now. When it is available, it will be downloadable
from http://www.phptr.com/perens
so check there for more information.
To be fully clear, this webpage is not the actual book.
Next: 11. Page Frame Reclamation
Up: 10. High Memory Management
Previous: 10.4 Bounce Buffers
  Contents
  Index
10.5 Emergency Pools
Two emergency pools of buffer_heads and pages are maintained
for the express use by bounce buffers. If memory is too tight for allocations,
failing to complete IO requests is going to compound the situation as buffers
from high memory cannot be freed until low memory is available. This leads
to processes halting, thus preventing the possibility of them freeing up their
own memory.
The pools are initialised by init_emergency_pool() to contain
POOL_SIZE10.5 entries each. The
pages are linked via the pagelist field on a list headed
by emergency_pages. Figure 10.5 illustrates how pages are stored on emergency pools and
acquired when necessary.
buffer_heads are very similar as they linked via the
buffer_headinode_buffers on a list headed by
emergency_bhs. The number of entries left on the pages and
buffer lists are recorded by two counters nr_emergency_pages
and nr_emergency_bhs respectively and the two lists are protected
by the emergency_lock spinlock.
Figure 10.5:
Acquiring Pages from Emergency
Pools
|
.
Footnotes
- ...POOL_SIZE10.5
- Currently defined as 32.
Next: 11. Page Frame Reclamation
Up: 10. High Memory Management
Previous: 10.4 Bounce Buffers
  Contents
  Index
Mel
2004-02-15