alloc_cpumask_var_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, welcome to alloc_cpumask_var_node(9) from the Kernel API Manual β€” this page is literally about allocating a struct cpumask on a given node. No cap. ✨

✨ SYNOPSIS ✨

bool alloc_cpumask_var_node (cpumask_var_t *mask , gfp_t flags , int
       node );

πŸŽ€ ARGUMENTS πŸŽ€

  • mask β€” a pointer to cpumask_var_t, and the cpumask gets returned through it. That's the output bestie. πŸ’…
  • flags β€” the GFP_ flags. Yep, those flags.
  • node β€” the memory node to allocate from, or NUMA_NO_NODE. Pick your node, or don't. πŸ¦‹

πŸ¦‹ DESCRIPTION πŸ¦‹

Real talk: this whole thing is only defined when CONFIG_CPUMASK_OFFSTACK=y. If that's not the case, it's a nop returning a constant 1 (in <linux/cpumask.h>). Iconic behavior, honestly.

Also, if this fails, mask will be NULL. And note that gcc is usually smart enough to know that mask can never be NULL if CONFIG_CPUMASK_OFFSTACK=n, so it does code elimination in that case too. The compiler ate, fr fr. πŸ”₯

🌈 RETURN 🌈

TRUE if memory allocation succeeded, FALSE otherwise. Simple as that, bestie. 🫢

πŸ‘‘ SEE ALSO πŸ‘‘

This section is giving linked-list energy β€” the Kernel file ./lib/cpumask.c and these function besties:


Cute sign-off: source/version ./lib, date October 2026, page alloc_cpumask_var_node(9) β€” bye bestie, go allocate responsibly! πŸ’–πŸŽ€

πŸ“¦ where this page comes from