What is the meaning of GFP in kmalloc flags?

user1485214 picture user1485214 · Jun 27, 2012 · Viewed 12.3k times · Source

What is the meaning of GFP flags in kmalloc? For instance GFP_KERNEL, GFP_ATOMIC?

Answer

ugoren picture ugoren · Jun 27, 2012

GFP = Get Free Pages = __get_free_pages.

These flags are flags passed to functions that allocate memory, such as __get_free_pages and kmalloc, telling them what can and can't be done while allocating.

For example, GFP_ATOMIC means no context-switch must happen while allocating (which means paging isn't possible).