Functions like kmalloc() accetp a "flags" argument: p = kmalloc(size, flags); What do these flags represent? The second kmalloc() argument, of type gfp_t (get free pages type) is a bitmask containing multiple flags that specify where kmalloc() is going to get the memory from, if the allocator can block waiting for I/O or something else, if the allocator can fail, etc... Some pre-defined constants provide important and useful flags combinations: - GFP_ATOMIC: the allocation is important and cannot block in any way (generally used in ISRs or BHs) - GFP_NOWAIT: the allocation cannot start any filesystem access or I/O, but can wake up a kernel thread performing by page reclaiming - GFP_KERNEL: "typical" allocation of memory for the kernel... This memory cannot be shared with user-space - GFP_USER: allocation of memory to be shared between user-space and kernel-space Some more information can be found at https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html