Библиотека сайта rus-linux.net
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: 7.5 Avoiding Fragmentation Up: 7. Physical Page Allocation Previous: 7.3 Free Pages   Contents   Index
Subsections
7.4 Get Free Page (GFP) Flags
A persistent concept through the whole VM is the Get Free Page
(GFP) flags. These flags determine how the allocator and kswapd
will behave for the allocation and freeing of pages. For example, an interrupt
handler may not sleep so it will not have the __GFP_WAIT
flag set as this flag indicates the caller may sleep. There are three sets
of GFP flags, all defined in linux/mm.h
.
The first of the three is the set of zone modifiers listed in Table 7.3. These flags indicate that the caller must try to allocate
from a particular zone. The reader will note there is not a zone modifier
for ZONE_ NORMAL
. This is because the zone modifier flag is used as an
offset within an array and 0 implicitly means allocate from ZONE_ NORMAL
.
The next flags are action modifiers listed in Table 7.4. They change the behavior of the VM and what the calling process
may do. The low level flags on their own are too primitive to be easily
used. It is difficult to know what the correct combinations are for each
instance so a few high level combinations are defined and listed in Table
7.5. For clarity the __GFP_
is removed from the table combinations so, the __GFP_HIGH
flag will read as HIGH
below. The combinations to form the high
level flags are listed in Table 7.6
To help understand this, take GFP_ATOMIC
as an example. It has
only the __GFP_HIGH
flag set. This means it is high priority,
will use emergency pools (if they exist) but will not sleep, perform IO
or access the filesystem. This flag would be used by an interrupt handler
for example.
7.4.1 Process Flags
A process may also set flags in the task_struct
which affects
allocator behavior. The full list of process flags are defined in
linux/sched.h
but only the ones affecting VM behavior
are listed in Table 7.7.
Next: 7.5 Avoiding Fragmentation Up: 7. Physical Page Allocation Previous: 7.3 Free Pages   Contents   Index Mel 2004-02-15