kfifo_alloc_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 to kmalloc. 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 πŸ‘‘


✨ 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