next up previous contents index
Next: 6.2 Managing Free Blocks Up: 6. Physical Page Allocation Previous: 6. Physical Page Allocation   Contents   Index

6.1 Allocator API

Linux provides a quite sizable API for the allocation of page frames. All of them take a gfp_mask which determines how the allocator will behave which is discussed in Section 6.5.

As the allocation API functions eventually map onto one function the API's are there so the correct node and zone will be chosen for the allocation. Different users will need different zones such as DMA for certain device drivers or NORMAL for disk buffers. A full list of page allocation API's are listed in Table 6.1.


Table 6.1: Physical Pages Allocation API
\begin{table}\begin{center}
\begin{tabularx}{13.5cm}{\vert X\vert}
\hline
\p...
...a virtual address \\ \\
\par
\hline
\end{tabularx}
\end{center} \end{table}


There is a similar API for the freeing of pages. They are a lot simpler and exist to help with the order of the block to free. One disadvantage of a buddy allocator is that the caller has to remember the size of the original allocation. The API for freeing is listed in Table 6.2.


Table 6.2: Physical Pages Free API
\begin{table}\begin{center}
\begin{tabularx}{13.5cm}{\vert X\vert}
\hline
\_...
...n virtual address \\ \\
\par
\hline
\end{tabularx}
\end{center} \end{table}



next up previous contents index
Next: 6.2 Managing Free Blocks Up: 6. Physical Page Allocation Previous: 6. Physical Page Allocation   Contents   Index
Mel 2003-01-14