The flip side of allocating memory is freeing it, of course. Memory leakage in the kernel is definitely not something you'd like to contribute to. For the page allocator APIs shown in Table 8.1, here are the corresponding free APIs:
API or macro name | Comment | API signature or macro |
free_page() | Free a (single) page that was allocated via the __get_free_page(), get_zeroed_page(), or alloc_page() APIs; it's a simple wrapper over the free_pages() API | #define free_page(addr) __free_pages((addr), 0) |
free_pages() | Free multiple pages that were allocated via the __get_free_pages() or alloc_pages() APIs (it's actually a wrapper over __free_pages().) | void free_pages(unsigned long addr, unsigned int order) |
__free_pages() | (Same as the preceding row, plus) it's the underlying routine where the work gets done; also, note that the first parameter is a pointer to... |