The Linux kernel provides (exposes to the core and modules) a set of APIs to allocate and deallocate memory (RAM) via the page allocator. These are often referred to as the low-level (de)allocator routines. The following table summarizes the page allocation APIs; you'll notice that all the APIs or macros that have two parameters, the first parameter is called the GFP flags or bitmask; we shall explain it in detail shortly, please ignore it for now. The second parameters is the order - the order of the freelist, that is, the amount of memory to allocate is 2order page frames. All prototypes can be found in include/linux/gfp.h:
API or macro name | Comments | API signature or macro |
__get_free_page() | Allocates exactly one page frame. The allocated memory will have random content; it's a wrapper around the __get_free_pages() API. The return value is a pointer to the just-allocated memory's kernel logical... |