alloc_cpumask_var_node(9)
πΈ 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 tocpumask_var_t, and the cpumask gets returned through it. That's the output bestie. πflagsβ theGFP_flags. Yep, those flags.nodeβ the memory node to allocate from, orNUMA_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:
alloc_bootmem_cpumask_var(9)free_cpumask_var(9)free_bootmem_cpumask_var(9)cpumask_local_spread(9)cpumask_any_and_distribute(9)cpumask_any_distribute(9)
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
- 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