kfifo_alloc_node(9)
πΈ kfifo_alloc_node(9) πΈ
okay bestie, welcome to the Kernel API Manual π this one's a kernel-space baddie, so grab your compiler and let's go β¨
β¨ NAME β¨
kfifo_alloc_node β dynamically allocates a new fifo buffer on a NUMA node π
π¦ SYNOPSIS π¦
kfifo_alloc_node (fifo , size , gfp_mask , node );
That's the whole vibe check right there β four args, no cap π
π ARGUMENTS π
fifoβ pointer to the fifo. literally just hand her the fifo and she'll do the rest π«Άsizeβ the number of elements in the fifo, and this must be a power of 2 β οΈ (like, 2, 4, 8, 16β¦ you get it, iykyk)gfp_maskβ get_free_pages mask, passed tokmalloc. this is the little permission slip she hands off to kmalloc πnodeβ NUMA node to allocate memory on. super picky about real estate, we love a girl with boundaries π
π DESCRIPTION π
So this macro dynamically allocates a new fifo buffer with NUMA node awareness. highkey iconic of her honestly πΈ
The number of elements will be rounded-up to a power of 2 β yes, even if you hand her something chaotic, she'll fix it for you β¨ (but the size arg still says it must be a power of 2, so don't push her π).
The fifo will be released with kfifo_free. that's the cleanup bestie, don't forget her π§
Return 0 if no error, otherwise an error code. so like β zero means slay, anything else means something went off π
π₯ SEE ALSO π₯
Kernel file ./include/linux/kfifo.h β go read the source, it's giving main character energy π
DECLARE_KFIFO_PTR(9)DECLARE_KFIFO(9)INIT_KFIFO(9)DEFINE_KFIFO(9)kfifo_initialized(9)kfifo_esize(9)kfifo_recsize(9)kfifo_size(9)kfifo_reset(9)kfifo_reset_out(9)kfifo_len(9)kfifo_is_empty(9)kfifo_is_empty_spinlocked(9)kfifo_is_empty_spinlocked_noirqsave(9)kfifo_is_full(9)kfifo_avail(9)kfifo_skip_count(9)kfifo_skip(9)kfifo_peek_len(9)kfifo_alloc(9)kfifo_free(9)kfifo_init(9)kfifo_put(9)kfifo_get(9)kfifo_peek(9)kfifo_in(9)kfifo_in_spinlocked(9)kfifo_in_spinlocked_noirqsave(9)kfifo_out(9)kfifo_out_spinlocked(9)kfifo_out_spinlocked_noirqsave(9)kfifo_from_user(9)kfifo_to_user(9)kfifo_dma_in_prepare_mapped(9)kfifo_dma_in_finish(9)kfifo_dma_out_prepare_mapped(9)kfifo_dma_out_finish(9)kfifo_out_peek(9)kfifo_out_linear(9)kfifo_out_linear_ptr(9)
β¨ and that's the whole page, bestie β¨ this little gem lives in ./include/linux, dated October 2026, and she's officially kfifo_alloc_node(9) π go forth and allocate, ily ππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms